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
Styling hardcoded <div> around CodeRay code table #76
Comments
I would either assign a block IAL to each codeblock or use a small javascript statement to style the parent |
@gettalong can you please reconsider this? Javascript shouldn't be used for styling and adding a Block Inline Attribute Lists feels very clumsy, especially when using Fenced code (which keeps the markdown nice an (c)lean). |
+1 In my opinion, it makes little sense to offer an "anonymous" wrapper. Because without a proper hook, authors have to wrap their code blocks inside an extra I was expecting to find the class |
Support for syntax highlighting will be changed in one of the next release to allow other highlighters - then I will change this. |
👏 |
The next version of kramdown will finally have such a class value. I.e. in case of coderay it would be |
Hi there,
I’m trying to style a CodeRay code table (
:coderay_line_numbers
set to:table
) in such a way that overflowing code is scrolled, i.e. I want to addto the element containing the code table. As can bee seen at https://github.com/gettalong/kramdown/blob/master/lib/kramdown/converter/html.rb#L109 this is sadly a hardcoded
<div>
element without any class or other identifier set, making it unreachable for CSS (unless you put an HTML attribute list after each and every single codeblock you write to include a class). Applyingoverflow-x: scroll
to the table itself doesn’t work, because it’s the table that overflows itself, requiring me to set this on the parent element, which is unreachable without changing kramdown’s code. Here’s an example of the generated HTML (the nonsense code is just to make it overflow):A workaround is setting
:coderay_line_numbers
to:inline
, but this in turn makes simple select-n-copy by mouse impossible (because the line numbers are now copied, too). Disabling line numbers altogether is not an option for me, as I sometimes have quite long code listings.Suggestion: Add a new option
coderay_div_class
or something like that that allows to globally apply a class to the<div>
sorrounding a coderay table.Valete,
Quintus
The text was updated successfully, but these errors were encountered: