diff options
-rw-r--r-- | code/makefile | 2 | ||||
-rw-r--r-- | code/src/markdown/mod.rs | 2 | ||||
-rw-r--r-- | code/src/markdown/parser.pest | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/code/makefile b/code/makefile index 1a943b0..45f1de5 100644 --- a/code/makefile +++ b/code/makefile @@ -19,7 +19,7 @@ out/feed.atom: $(TOOL) $(SRC_ARTICLES) out/%: articles/%.md $(TOOL) out/style.css $(TOOLC) render-article $< > $@ -$(TOOL): $(shell find ../code/src -type f) $(shell find ../code/grammar -type f) +$(TOOL): $(shell find ../code/src -type f) sh -c 'cd ../code; cargo build' clean: diff --git a/code/src/markdown/mod.rs b/code/src/markdown/mod.rs index 7ee18a2..68386cc 100644 --- a/code/src/markdown/mod.rs +++ b/code/src/markdown/mod.rs @@ -13,7 +13,7 @@ struct Grammar; pub fn render(s: &str) -> String { match Grammar::parse(Rule::file, s) { Ok(pairs) => { - eprintln!("{pairs:#?}"); + // eprintln!("{pairs:#?}"); render_pairs(pairs) } Err(e) => panic!("{e}"), diff --git a/code/src/markdown/parser.pest b/code/src/markdown/parser.pest index 22563d4..a15277f 100644 --- a/code/src/markdown/parser.pest +++ b/code/src/markdown/parser.pest @@ -3,9 +3,9 @@ file = _{ SOI ~ NEWLINE* ~ (block ~ NEWLINE*)* ~ EOI } block = { code_block | latex_block | header | unordered_list | ordered_list | paragraph } header = { "#"{1,6} ~ span } unordered_list = { unordered_list_item+ } - unordered_list_item = { "-" ~ span ~ NEWLINE } + unordered_list_item = { "- " ~ span ~ NEWLINE } ordered_list = { ordered_list_item+ } - ordered_list_item = { ASCII_DIGIT+ ~ "." ~ span ~ NEWLINE } + ordered_list_item = { ASCII_DIGIT+ ~ ". " ~ span ~ NEWLINE } paragraph = { span } code_block = { "```" ~ code_block_lang ~ NEWLINE ~ code_block_inner ~ "```" } code_block_lang = { ASCII_ALPHANUMERIC* } @@ -26,4 +26,4 @@ span = { (style_bold | style_italic | style_code | inline_latex | hyperlink | te hyperlink_location = { (!")" ~ANY)+ } text = { (!("[" | "]" | "*" | "_" | "`" | "$" | ("\n" ~ forbidden_span_wrap)) ~ ANY)+ } - forbidden_span_wrap = _{ "\n" | "-" | ASCII_DIGIT+ ~ "." } + forbidden_span_wrap = _{ "\n" | "- " | ASCII_DIGIT+ ~ ". " } |