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

Org reader support for ATTR_HTML statements #2927

Merged
merged 3 commits into from May 19, 2016
Merged

Conversation

tarleb
Copy link
Collaborator

@tarleb tarleb commented May 19, 2016

Arbitrary key-value pairs can be added to some block types using a #+ATTR_HTML line before the block. Emacs Org-mode only includes these when exporting to HTML, but since we cannot make this distinction here, the attributes are always added.

The functionality is now supported for figures.

This closes #1906.

A parser state attribute was used to keep track of block attributes
defined in meta-lines.  Global state is undesirable, so block attributes
are no longer saved as part of the parser state.  Old functions and the
respective part of the parser state are removed.
Additional state changes need to be made after a newline is parsed,
otherwise markup may not be recognized correctly.

This fixes a bug where markup after certain block-types would not be
recognized. E.g. `/emph/` in the following snippet was not parsed as
emphasized.

    foo
    # comment
    /emph/
Arbitrary key-value pairs can be added to some block types using a
`#+ATTR_HTML` line before the block.  Emacs Org-mode only includes these
when exporting to HTML, but since we cannot make this distinction here,
the attributes are always added.

The functionality is now supported for figures.

This closes jgm#1906.
@robstewart57
Copy link

@tarleb

The functionality is now supported for figures.

Can you confirm that this currently therefore work for ATTR_HTML tags of org tables? E.g.

#+ATTR_HTML: :class table-dark
| h1 | h2 |
|----|----|
| c1 | c2 |

The HTML generated by hakyll (which uses pandoc to parse the org mode syntax) doesn't include the table-dark class to <table>. I'd expect to see in the generated HTML:

<table class="table-dark">

Instead I see:

<table>

Is this because pandoc ignores

#+ATTR_HTML: :class table-dark

Or because hakyll isn't make use of it?

@tarleb
Copy link
Collaborator Author

tarleb commented Jun 7, 2020

Thank you for finding this issue. However, this is an over 4 year old pull request. A better place to ask these question would be the pandoc-discuss mailing list.

Table attributes are not supported yet; pandoc's internal representation has been greatly improved in the current development version, so adding this is feasible. Please raise a new issue for us to keep track.

@robstewart57
Copy link

@tarleb thanks for your reply.

Please raise a new issue for us to keep track.

Done #6441 .

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

Successfully merging this pull request may close these issues.

Org reader support for ATTR_HTML
3 participants