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

Include cell header information in table_cell callback. #605

Closed
wants to merge 1 commit into from

Conversation

mlambley
Copy link

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
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
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
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
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