Skip to content

Include cell header information in table_cell callback.#605

Closed
mlambley wants to merge 1 commit intovmg:masterfrom
mlambley:master
Closed

Include cell header information in table_cell callback.#605
mlambley wants to merge 1 commit intovmg:masterfrom
mlambley:master

Conversation

@mlambley
Copy link
Copy Markdown

Copy flag bitmask logic from html.c to rc_render.c.
Pass whether or not the cell is a header (th) to the table_cell callback.
Update readme and render_strip to match.

…ot the cell is a header (th) to the table_cell callback. Update readme and render_strip to match.
@mlambley
Copy link
Copy Markdown
Author

mlambley commented Feb 28, 2017

Example code for override:

def table_cell(content, alignment, header)
    if alignment
        class = " class='" + alignment.to_s + "'"
    else
        class = ""
    end
    
    if header
        "<th" + class + ">" + content + "</th>"
    else
        "<td" + class + ">" + content + "</td>"
    end
end

@robin850
Copy link
Copy Markdown
Collaborator

robin850 commented Mar 1, 2017

Hi @mlambley,

The problem with your patch is that it would introduce a breaking change ; a render object wouldn't work with the current version of Redcarpet and the next one. Let me think about this a bit more, maybe we could look at the method's arity to know how many arguments should be passed.

Thank you very much for the pull request, getting back to you soon ! :-)

@mlambley
Copy link
Copy Markdown
Author

mlambley commented May 2, 2019

@robin850 How often do you release breaking changes? I'm happy to spruce up this PR if necessary if it means being merged sometime soon.

@robin850
Copy link
Copy Markdown
Collaborator

Hello @mlambley,

I lied when I said "getting back to you soon" but your patch has been polished a bit to be backward compatible. You can find the final patch in 27dfb2a ; you've been properly credited. This should be available once Redcarpet 3.6.0 is released.

Thank you very much and sorry for the lasting status quo. ❤️

@robin850 robin850 closed this Feb 28, 2021
robin850 added a commit that referenced this pull request Feb 28, 2021
Following up to #605.
robin850 added a commit that referenced this pull request Feb 28, 2021
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.

3 participants