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

RST Reader does not check the :class: field for custom roles #7699

Closed
willj-dev opened this issue Nov 18, 2021 · 1 comment · Fixed by #7700
Closed

RST Reader does not check the :class: field for custom roles #7699

willj-dev opened this issue Nov 18, 2021 · 1 comment · Fixed by #7700
Labels

Comments

@willj-dev
Copy link
Contributor

Explain the problem.

The relevant RST documentation is under the role directive:

The following option is recognized by the "role" directive for most base roles:

class : text
Set the "classes" attribute value on the element produced (inline, or element associated with a base class) when the custom interpreted text role is used. If no directive options are specified, a "class" option with the directive argument (role name) as the value is implied. See the class directive above.

As shown in the example below, Pandoc 2.16.1 always uses the role name for the element class, and always ignores the :class: field in a custom role.

Example RST:

.. role: classy
  :class: myclass

:classy:`hello`

Pandoc command: pandoc -f rst -t html5 -o test.html test.rst

Output HTML5:

<p><span class="classy">hello</span></p>

Expected output:

<p><span class="myclass">hello</span></p>

Pandoc version?
2.16.1, Windows

@willj-dev willj-dev added the bug label Nov 18, 2021
@willj-dev
Copy link
Contributor Author

I will have a PR for this imminently!

@jgm jgm closed this as completed in #7700 Nov 19, 2021
jgm pushed a commit that referenced this issue Nov 19, 2021
Previously the class attribute was ignored, and the name of the role used as the class.
Closes #7699.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant