Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hard line breaks in block AsciiMath are not preserved #91

Open
mojavelinux opened this issue Nov 23, 2020 · 5 comments
Open

Hard line breaks in block AsciiMath are not preserved #91

mojavelinux opened this issue Nov 23, 2020 · 5 comments

Comments

@mojavelinux
Copy link
Member

mojavelinux commented Nov 23, 2020

AsciiMath blocks require special line handling. You can find the logic here: https://github.com/asciidoctor/asciidoctor/blob/dd843d59b1e49f29d68386bfdf0438ce11b42577/lib/asciidoctor/converter/html5.rb#L697

The rules are as follows:

  1. Two lines separated by only a newline character become a single line (the current behavior)
  2. A line that ends with \ should become a hard line break
  3. A double line break (and any additional line breaks) should be preserved (effectively separating the equations).

2 & 3 are not honored.

See asciidoctor/asciidoctor#2497 (comment) for the specification and examples.

@SpyrosRoum
Copy link

SpyrosRoum commented Nov 23, 2020

Hey do you think this might be something easy for someone who doesn't know ruby to implement?
I really like asciidoctor so far and you have already helped me so I'd like to give back!
Learning Ruby is not in my todo list but I already know python and Rust so maybe I can hack something together based on the logic you linked

@christopherball
Copy link

+1 for supporting hard line breaks in native AsciiMath syntax. This is a major pain for my tooling right now, as I ended up going with the approach of translating /r's into separate `` chunks, which means I can't save off a single SVG since they're considered separate blocks. Any ETA on getting a fully supported line break in place?

@mojavelinux
Copy link
Member Author

@SpyrosRoum This seems relatively straightforward to implement. I'd be happy to mentor you if you need assistance.

@mcp292
Copy link

mcp292 commented Dec 3, 2022

@SpyrosRoum @mojavelinux Thank you both for dedicating your time to this. @mojavelinux Thank you for being so welcoming and helpful.

Has any progress been made on this front? I ran into this on:

$ asciidoctor-pdf -v
----
Asciidoctor PDF 2.3.4 using Asciidoctor 2.0.18 [https://asciidoctor.org]
Runtime Environment (ruby 3.0.4p208 (2022-04-12 revision 3fa771dded) [x86_64-linux]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8)

Edit:
I'm also having this problem when using :stem: latexmath.

@mojavelinux
Copy link
Member Author

I'm also having this problem when using :stem: latexmath.

It seems this problem is not limited to AsciiMath.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants