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

handling br inside formatting tags #780

Closed
directionless opened this issue Mar 3, 2023 · 2 comments
Closed

handling br inside formatting tags #780

directionless opened this issue Mar 3, 2023 · 2 comments
Assignees
Labels

Comments

@directionless
Copy link

I'm trying to convert html to markdown. Playing with Kramdown, it's pretty cool. But, I found a bit of a corner case. If there are br tags inside formatting, it comes out a bit funny. Honestly I'm not really sure what correct should be, but:

[78] pry(main)> Kramdown::Document.new('<h1>foo<br>bar</h1>', :input => 'html').to_kramdown
=> "# foo  \nbar\n\n"
@gettalong gettalong self-assigned this Mar 3, 2023
@gettalong gettalong added the bug label Mar 3, 2023
@gettalong
Copy link
Owner

Thanks for the report! From a cursory look at it I think this is a bug in the HTML to AST conversion scheme.

@gettalong
Copy link
Owner

After having a more in-depth look at this, I have adapted the kramdown converter to correctly handle such cases.

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

No branches or pull requests

2 participants