Skip to content

handling inline html #597

Description

@u-fischer

I have a markdown file which contains x<sub>2</sub> to set x2.

How is one supposed to define a renderer for this? The inlineHtmlTag only gets one argument, the html tag, and I see no way to get at the content between both tags to put braces around the argument?

As I have only one number I tried to cheat and let the begin tag grab the argument. That actually worked in a small example, but fails in the real document as relativeReferences disables the html processing ;-(

\documentclass{article}
\usepackage[%relativeReferences   %with it it doesn't work.         
            ]{markdown}
\ExplSyntaxOn
\markdownSetup {rendererPrototypes = 
 {
   inlineHtmlTag=\str_if_eq:nnT{#1}{<sub>}{\textsubscript}   
 }}
\ExplSyntaxOff 
\begin{document}
\begin{markdown}
x<sub>2</sub> 
\end{markdown}
\end{document}

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    commonmarkRelated to making the syntax of markdown follow the CommonMark specfeature requesthtmlRelated to our support for HTML content.luaRelated to the Lua interface and implementationquestion

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions