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

Support <small> in HTML Reader and AsciiDoc Writer #5080

Closed
znerd opened this issue Nov 15, 2018 · 9 comments
Closed

Support <small> in HTML Reader and AsciiDoc Writer #5080

znerd opened this issue Nov 15, 2018 · 9 comments

Comments

@znerd
Copy link

znerd commented Nov 15, 2018

Please support <small> in HTML input and translate it to [.small] in AsciiDoc output.

Sample input:

This <small>MUST NOT</small> be done.

Sample output:

This [.small]#MUST NOT# be done.

Extra information:

@jgm
Copy link
Owner

jgm commented Nov 15, 2018

We don't have a dedicated element for this. We could consider parsing it as a native Span with class "small". That would mean it would be treated exactly the same as <span class="small">MUST NOT</span>. Note that we currently use spans with class smallcaps for small caps.

@znerd
Copy link
Author

znerd commented Nov 15, 2018

We could consider parsing it as a native Span with class "small". That would mean it would be treated exactly the same as <span class="small">MUST NOT</span>.

If that produces [.small]#MUST NOT# in AsciiDoc, then great. Then that loop is at least closed.

@znerd
Copy link
Author

znerd commented Nov 15, 2018

I tried converting this HTML:

<span class="small">Smaller</span>

…to AsciiDoc using Pandoc, but it just results in:

Smaller

@znerd
Copy link
Author

znerd commented Nov 15, 2018

I also tried this HTML:

<span style="font-size:small">Smaller</span>

…but again, converting it to AsciiDoc just produces this:

Smaller

Is there something that will generate this AsciiDoc?

[.small]#MUST NOT#

@jgm
Copy link
Owner

jgm commented Nov 16, 2018 via email

@jgm
Copy link
Owner

jgm commented Nov 16, 2018

With the commit I just pushed, <span class="small">hi</span> will turn into [.small]#hi#.

@jgm jgm closed this as completed in e61f632 Nov 16, 2018
@znerd
Copy link
Author

znerd commented Nov 16, 2018

<span class="small">hi</span> will turn into [.small]#hi#.

What about an HTML <small> tag? Will it also be interpreted as <span class="small"> ?

If not, should we keep this issue open until that is also covered? Or is that part of the request rejected?

(Note that I'm not too bothered if it is indeed rejected, because I would do some preprocessing of the HTML to convert any <small> to a <span class="small"> myself…)

@mb21
Copy link
Collaborator

mb21 commented Nov 16, 2018

@znerd yes, the HTML tag is converted. See the test in the referenced commit.

@znerd
Copy link
Author

znerd commented Nov 16, 2018

@jgm Thanks!

I checked the referenced, but my Haskell skills are seriously lacking, I'm afraid. I find it difficult to interpret the code.

My background is in procedural languages (C, Java, etc.) and while I've done some functional programming (Clean) in the past, it's seriously rusty, and the syntax is not immediately obvious to me.

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

No branches or pull requests

3 participants