From d0ff550b264206109349f0385c145f340ddf992b Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Sun, 19 Jan 2025 18:49:36 +1300 Subject: Change syntax Internal links are now delimited with braces, and external links are now delimited with angle brackets. A label is separated from a path in an external link with two consecutive colons. Embed blocks are now delimited with angle brackets in the same manner as external links, with label separated from path with two consecutive colons. Embed blocks still begin with a single exclamation mark. Bold line elements are now delimited with only a single * character, instead of two. This is to match the other delimiters, which each use only a single character. --- src/token.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/token.rs') diff --git a/src/token.rs b/src/token.rs index c2b1179..f1f8288 100644 --- a/src/token.rs +++ b/src/token.rs @@ -17,8 +17,11 @@ impl AsRef for Token { Token::Italic(text) => text, Token::Monospace(text) => text, Token::Math(text) => text, - Token::InternalLink(label) => label, - Token::ExternalLink { label, ..} => label, + Token::InternalLink(name) => name, + Token::ExternalLink { label, path } => match !label.is_empty() { + true => label, + false => path, + }, } } } -- cgit v1.2.3-70-g09d2