Skip to content

Commit

Permalink
PR #48 match changes for djot.js 3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
hellux committed Mar 18, 2024
2 parents d5f32e4 + b43f4a5 commit e7646f1
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 18 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test_html_ut:
ln -fs ../../../modules/djot.js/test/$$f tests/html-ut/ut/djot_js_$$f; \
done
cargo test -p test-html-ut
cargo test -p test-html-ut -- --ignored 2>/dev/null | grep -q 'test result: FAILED. 0 passed'
cargo test -p test-html-ut -- --ignored 2>/dev/null | grep -qE 'test result: .* 0 passed'

.PHONY: test_html_ref
test_html_ref:
Expand All @@ -42,7 +42,7 @@ test_html_ref:
ln -fs ../../modules/djot.js/bench/$$f tests/html-ref/$$dst; \
done
cargo test -p test-html-ref
cargo test -p test-html-ref -- --ignored 2>/dev/null | grep -q 'test result: FAILED. 0 passed'
cargo test -p test-html-ut -- --ignored 2>/dev/null | grep -qE 'test result: .* 0 passed'

.PHONY: bench
bench:
Expand Down
2 changes: 1 addition & 1 deletion modules/djot.js
Submodule djot.js updated 55 files
+0 −2 .gitignore
+85 −0 CHANGELOG.md
+10 −0 README.md
+0 −19 bench/bench.js
+0 −8 bench/block-bq-flat.dj
+0 −15 bench/block-bq-nested.dj
+0 −11 bench/block-code.dj
+0 −12 bench/block-fences.dj
+0 −13 bench/block-heading.dj
+0 −7 bench/block-hr.dj
+0 −71 bench/block-list-flat.dj
+0 −35 bench/block-list-nested.dj
+0 −15 bench/block-ref-flat.dj
+0 −10 bench/block-ref-nested.dj
+0 −13 bench/inline-autolink.dj
+0 −3 bench/inline-backticks.dj
+0 −5 bench/inline-em-flat.dj
+0 −5 bench/inline-em-nested.dj
+0 −6 bench/inline-em-worst.dj
+0 −9 bench/inline-escape.dj
+0 −22 bench/inline-links-flat.dj
+0 −15 bench/inline-links-nested.dj
+0 −64 bench/lorem1.dj
+145 −0 djot-schema.json
+86 −115 doc/djot.1
+1 −1 doc/djot.md
+10,363 −0 package-lock.json
+4 −4 package.json
+7 −5 playground/index.js
+2 −1 release_checklist.md
+2 −0 src/ast.ts
+11 −1 src/attributes.spec.ts
+30 −6 src/attributes.ts
+3 −0 src/block.spec.ts
+26 −9 src/block.ts
+18 −0 src/djot-renderer.spec.ts
+18 −5 src/djot-renderer.ts
+23 −0 src/filter.spec.ts
+7 −12 src/filter.ts
+16 −12 src/fuzz.spec.ts
+17 −0 src/html.spec.ts
+29 −14 src/html.ts
+68 −0 src/index.ts
+14 −0 src/inline.spec.ts
+3 −6 src/pandoc.spec.ts
+71 −36 src/pandoc.ts
+2 −0 src/parse.spec.ts
+70 −24 src/parse.ts
+1 −1 src/version.ts
+29 −3 test/attributes.test
+1 −1 test/emphasis.test
+7 −7 test/footnotes.test
+21 −0 test/regression.test
+30 −30 test/smart.test
+3,448 −0 yarn.lock
3 changes: 3 additions & 0 deletions src/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ impl State {
_ => Invalid,
},
Comment if c == b'%' => Whitespace,
Comment if c == b'}' => Done,
Comment => Comment,
ClassFirst if is_name(c) => Class,
ClassFirst => Invalid,
Expand Down Expand Up @@ -557,8 +558,10 @@ mod test {

#[test]
fn comment() {
test_attr!("{%}");
test_attr!("{%%}");
test_attr!("{ % abc % }");
test_attr!("{ .some_class % #some_id }", ("class", "some_class"));
test_attr!(
"{ .some_class % abc % #some_id}",
("class", "some_class"),
Expand Down
16 changes: 8 additions & 8 deletions src/html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,13 +376,13 @@ impl<'s> Writer<'s> {
}
}
Event::Symbol(sym) => write!(out, ":{}:", sym)?,
Event::LeftSingleQuote => out.write_str("&lsquo;")?,
Event::RightSingleQuote => out.write_str("&rsquo;")?,
Event::LeftDoubleQuote => out.write_str("&ldquo;")?,
Event::RightDoubleQuote => out.write_str("&rdquo;")?,
Event::Ellipsis => out.write_str("&hellip;")?,
Event::EnDash => out.write_str("&ndash;")?,
Event::EmDash => out.write_str("&mdash;")?,
Event::LeftSingleQuote => out.write_str("")?,
Event::RightSingleQuote => out.write_str("")?,
Event::LeftDoubleQuote => out.write_str("")?,
Event::RightDoubleQuote => out.write_str("")?,
Event::Ellipsis => out.write_str("")?,
Event::EnDash => out.write_str("")?,
Event::EmDash => out.write_str("")?,
Event::NonBreakingSpace => out.write_str("&nbsp;")?,
Event::Hardbreak => out.write_str("<br>\n")?,
Event::Softbreak => out.write_char('\n')?,
Expand Down Expand Up @@ -434,7 +434,7 @@ impl<'s> Writer<'s> {
}
write!(
out,
r##"<a href="#fnref{}" role="doc-backlink">↩︎︎</a></p>"##,
"<a href=\"#fnref{}\" role=\"doc-backlink\">\u{21A9}\u{FE0E}</a></p>",
number,
)?;

Expand Down
2 changes: 0 additions & 2 deletions tests/html-ref/skip
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
block_list_flat:large list marker number
inline_links_flat:space before img, img attrs order
1 change: 1 addition & 0 deletions tests/html-ut/skip
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
f4f22fc:attribute key class order
ae6fc15:bugged left/right quote
168469a:bugged left/right quote
2fa94d1:bugged left/right quote
e1f5b5e:untrimmed whitespace before linebreak
07888f3:div close within raw block
8423412:heading id conflict with existing id
Expand Down
10 changes: 5 additions & 5 deletions tests/html-ut/ut/footnotes.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ Footnote references may appear within a footnote.
<hr>
<ol>
<li id="fn1">
<p>a<a id="fnref2" href="#fn2" role="doc-noteref"><sup>2</sup></a><a id="fnref3" href="#fn3" role="doc-noteref"><sup>3</sup></a><a href="#fnref1" role="doc-backlink">↩︎︎</a></p>
<p>a<a id="fnref2" href="#fn2" role="doc-noteref"><sup>2</sup></a><a id="fnref3" href="#fn3" role="doc-noteref"><sup>3</sup></a><a href="#fnref1" role="doc-backlink">↩</a></p>
</li>
<li id="fn2">
<p>b<a href="#fnref2" role="doc-backlink">↩︎︎</a></p>
<p>b<a href="#fnref2" role="doc-backlink">↩</a></p>
</li>
<li id="fn3">
<p><a href="#fnref3" role="doc-backlink">↩︎︎</a></p>
<p><a href="#fnref3" role="doc-backlink">↩</a></p>
</li>
</ol>
</section>
Expand Down Expand Up @@ -48,10 +48,10 @@ Footnotes may appear within footnotes.
<hr>
<ol>
<li id="fn1">
<p>inner<a href="#fnref1" role="doc-backlink">↩︎︎</a></p>
<p>inner<a href="#fnref1" role="doc-backlink">↩</a></p>
</li>
<li id="fn2">
<p><a href="#fnref2" role="doc-backlink">↩︎︎</a></p>
<p><a href="#fnref2" role="doc-backlink">↩</a></p>
</li>
</ol>
</section>
Expand Down

0 comments on commit e7646f1

Please sign in to comment.