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

Cannot render circumflex #5

Closed
apjanke opened this issue Dec 22, 2018 · 6 comments
Closed

Cannot render circumflex #5

apjanke opened this issue Dec 22, 2018 · 6 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@apjanke
Copy link
Owner

apjanke commented Dec 22, 2018

Copied from rtomayko/ronn#101.

The following Markdown snippet contains a circumflex but it is discarded (or converted to an "=") in the conversion to roff. There does not appear to be a way to render a circumflex.

[~/tmp/ronn-test/render-circumflex]
$ cat test.md                                                                                                                             ✘ 1
# test - render a circumflex

## DESCRIPTION

We are trying to render a circumflex.

y = 2^x

[~/tmp/ronn-test/render-circumflex]
$ ronn test.md
warn: cannot load such file -- ronn. adding /Users/janke/local/repos/ronn-ng/lib to RUBYLIB ...
     roff: ./test
warn: unrecognized inline tag: "sup"
     html: ./test.html                                           +man
[~/tmp/ronn-test/render-circumflex]
$ cat test
.\" generated with Ronn-NG/v0.7.3
.\" http://github.com/apjanke/ronn-ng/tree/0.7.3
.
.TH "TEST" "" "December 2018" "" ""
.
.SH "NAME"
\fBtest\fR \- render a circumflex
.
.SH "DESCRIPTION"
We are trying to render a circumflex\.
.
.P
y = 2
[~/tmp/ronn-test/render-circumflex]
$
@apjanke apjanke self-assigned this Dec 22, 2018
@apjanke apjanke added the bug Something isn't working label Dec 22, 2018
@apjanke apjanke added this to the 0.7.4 milestone Dec 22, 2018
@apjanke apjanke modified the milestones: 0.7.4, 0.7.5 Dec 22, 2018
@apjanke
Copy link
Owner Author

apjanke commented Dec 22, 2018

In the HTML section, it renders like this:

<p>y = 2<sup>x</sup></p>

and the warning says warn: unrecognized inline tag: "sup", so I bet it's just dropping the contents of that <sup> tag, which is the missing ^x.

@apjanke
Copy link
Owner Author

apjanke commented Dec 22, 2018

I added a hacky handling that converts the HTML <sup>...</sup> back to ^(...) in the roff text.

@apjanke
Copy link
Owner Author

apjanke commented Dec 24, 2018

Re-opening this because I'm not sure I handled it right.

I read through the main Markdown syntax definition, and it doesn't have a "^" for superscript markup. So I'm not sure why it's getting converted as such. Maybe it's an extension in rdiscount or another Markdown library being used?

@apjanke
Copy link
Owner Author

apjanke commented Dec 24, 2018

Yep, the "^ for superscript" is an RDiscount extension. I've disabled it in the processor by using RDiscount's :strict mode.

Newer versions of RDiscount support a specific :no_superscript option, but that doesn't seem to be available in RDiscount 1.6.8.

@apjanke
Copy link
Owner Author

apjanke commented Dec 24, 2018

Nope, can't do that. It breaks tests.

@apjanke
Copy link
Owner Author

apjanke commented Dec 24, 2018

Okay, got a real fix by upgrading to RDiscount 2.x and using the :no_superscript option. Tests still pass this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

1 participant