CLJS: inline formula ends at a line break
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 87/100
Research direction
Start with the math_inline regex in src/js/markdown-it-texmath.js and the inline-formula-delimiters-test. The issue provides the failing CLJS input and expected parse; first check how the dollars rule handles line breaks and how the JVM-only test is set up. Update the regex and make that case shared, then confirm CLJS parses one formula across the line break.
Written by the indexing model from the issue text.
Description
On CLJS a $...$ formula ends at a line break. A hard-wrapped paragraph that breaks inside a formula shows the dollars as text. The JVM and Pandoc parse one formula:
(md/parse "a $x\ny$ b")
;; JVM: [:text "a "] [:formula "x\ny"] [:text " b"]
;; CLJS: [:text "a $x"] [:softbreak] [:text "y$ b"]
;; Pandoc: Math InlineMath "x y"
Clerk notebooks rely on this on the JVM, for example src/emmy/dual.cljc in mentat-collective/emmy, which breaks $i^2 = and -1$ over two lines.
The math_inline regex of the dollars rules in src/js/markdown-it-texmath.js uses .*?, which does not match \n. Use [\s\S]*? and make the JVM-only case in inline-formula-delimiters-test a shared test.
- Dominant language
- Clojure
- Stars
- 100
- Forks
- 11
- Avg merge
- 2h 3m
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nextjournal/markdown
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
nextjournal/markdown#77 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
nextjournal/markdown#65 · 6 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
nextjournal/markdown#64 · 7 comments · 1 reaction ·
All issues in nextjournal/markdown
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
nextjournal/clerk#830 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
IOP tokens release blocker team qa team qa autotests WG adoption
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
penpot/penpot#13540 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
izhangzhihao/intellij-rainbow-brackets#2903 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100