-
Notifications
You must be signed in to change notification settings - Fork 31
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
Pass HTML through to TeX4ht #90
Comments
That's a great idea! I already tested the Markdown package with TeX4ht and it works in most cases. I think that I experienced some errors, but I don't remember what was the cause. Anyway, regarding passing HTML from Markdown, I think that just
It produces a following HTML with
Without |
@michal-h21 I have added todos for this issue (see #90 (comment)) and I plan to tackle them by the end of the month. I have a couple of concerns:
|
@Witiko yes, it is possible to input contents of HTML file, using the The following code shows the concept:
The I can surely help with the example. |
@michal-h21 Thank you, this is much appreciated! |
@michal-h21 In b00280b, I added an example document. The good news is that the HTML pass-through works as expected: Here is some <b>HTML code</b> mixed *with Markdown*. In pdf \TeX, the HTML code
will be silently ignored, whereas in \TeX 4ht, the HTML code will be passed
through to the output:
<table border="1">
<tr>
<td>Emil</td>
<td>Tobias</td>
<td>Linus</td>
</tr>
<tr>
<td>16</td>
<td>14</td>
<td>10</td>
</tr>
</table> |
The bad news is that with up-to-date TeX Live 2021, the compilation produces some errors that seem pretty arcane to me: To see what was going on, I ran the following command. The error log indicates that at some point
Worse yet, make4ht seems to crash our continuous integration with TeX Live 2018 and 2019:
Since I would like to release today or tomorrow, I plan to merge commit 44affc3 and ship Markdown 2.14.0 without an example document TeX4ht, which I would merge later when ready. However, if we could get the example document in order today or tomorrow at the latest, we could ship it with Markdown 2.14.0 already. |
@Witiko this issue seems to be caused by tables. I think this issue is caused by these lines in
As TeX4ht overwrites |
Always a pleasure to see someone more capable at work! I added |
The example document seems passable except for the imbalanced > This is the first level of quoting.
>
> > This is nested blockquote.
>
> Back to the first level. <div class="center-quotation"><table class="quotation"
border="0" cellpadding="0" cellspacing="15"><tr><td>
<blockquote class="quotation">
<!--l. 87--><p class="indent" > This is the first level of quoting.
</p>
<div class="center-quotation"><table class="quotation"
border="0" cellpadding="0" cellspacing="15"><tr><td>
<blockquote class="quotation">
<!--l. 89--><p class="indent" > This is nested blockquote.</p></blockquote>
</td></tr></table></center>
Back to the first level.</blockquote>
</td></tr></table></center> It seems like TeX4ht should close the opening |
@Witiko this is strange, it shouldn't produce any
|
@michal-h21 Interesting. I have the following minimal example document \documentclass{article}
\usepackage{markdown}
\begin{document}
\begin{markdown}
> This is the first level of quoting.
>
> > This is nested blockquote.
>
> Back to the first level.
\end{markdown}
\end{document} Running <div class="center-quotation"><table class="quotation"
border="0" cellpadding="0" cellspacing="15"><tr><td>
<blockquote class="quotation">
<!--l. 3--><p class="indent" > This is the first level of quoting.
</p>
<div class="center-quotation"><table class="quotation"
border="0" cellpadding="0" cellspacing="15"><tr><td>
<blockquote class="quotation">
<!--l. 5--><p class="indent" > This is nested blockquote.</p></blockquote>
</td></tr></table></center>
Back to the first level.</blockquote>
</td></tr></table></center> |
I've found that this happens with the |
Thank you. In that case, I think we can merge and release this branch. |
I hope so. I've already found the cause of the HTML validation error, but I am still not sure why we execute this code when Amsmath is loaded. |
I've found also the underlying issue, there was some line that configured |
Since version 2.3.0, the Markdown package has supported the
html
Lua option, which makes the Lua parser recognize display and inline HTML. Since version 2.10.0, inline HTML comments have been actionable, but other HTML nodes have been removed during the conversion to TeX. In order to enable the conversion from Markdown to HTML using @michal-h21's make4ht without the loss of HTML, as discussed in #63 (comment), we should:inlineHtmlTag
renderer that will handle opening, closing, and empty inline HTML tags.inlineHtmlComment
renderer for inline HTML comments.inputBlockHtmlElement
renderer for block HTML elements.inputBlockHtmlComment
renderer for HTML comments that span several paragraphs.inlineHtmlTag
LaTeX renderer prototype produce the\HCode
command (see also Pass HTML through to TeX4ht #90 (comment)) to pass HTML through to TeX4ht.inputBlockHtmlElement
LaTeX renderer prototype produce the\special
command (see also Pass HTML through to TeX4ht #90 (comment)) to pass HTML through to TeX4ht.html
Lua option.We should add these definitions to markdown.dtx, not to the TeX4ht literate sources, since users may completely change the semantics of the HTML nodes by redefining the renderers. In that case, we don't want the renderers to produce
\HCode
.The text was updated successfully, but these errors were encountered: