---------- Forwarded message ---------
From: Darren Ng <[email protected]>
Date: Fri, Jul 30, 2021 at 12:45 AM
Subject: Extension - custom role - emit HTML with an 'a' tag wrapped in 'em' tag
To: <[email protected]>


Title: Extension - custom role - emit HTML with an 'a' tag wrapped in 'em' tag

With the following extension, I get
'<p><strong><em>asdf</em><sup>2</sup></strong></p>'
from ':emlink:`whatsoever`' successfully.

    def emlink_fn(name, rawtext, text, lineno, inliner, options={}, content=[]):
        ...
        root = docutils.nodes.strong()
        root += docutils.nodes.emphasis(text='asdf')
        root += docutils.nodes.superscript(text='2')
        return [root], []
        ...
    def setup(app):
        ...
        app.add_role(name='emlink',
                     role=emlink_fn,
                     override=False)
        ...

Now I want '<p><em><a href="https://example.org";>an example</a></em></p>'.

        ...
        root = docutils.nodes.emphasis()
        root += docutils.nodes.<I_HAVE_NO_IDEA>(<I_HAVE_NO_IDEA>)
        ...

What should I do?

Jul 30, 2021
Darren Ng

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/CAJferp8xEf3T-PXA1szpJLRGseNdfTM0BWQ1yrUZ7rPvoAzN9w%40mail.gmail.com.

Reply via email to