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

Support <br> in docs-builder #335

Closed
bmorelli25 opened this issue Jan 23, 2025 · 4 comments · Fixed by #342
Closed

Support <br> in docs-builder #335

bmorelli25 opened this issue Jan 23, 2025 · 4 comments · Fixed by #342
Assignees
Labels
authoring Relates to our markdown parser enhancement

Comments

@bmorelli25
Copy link
Member

Summary

We need to support the ability to add line breaks. The <br> HTML tag is a common method of supporting this feature in md authoring tools. We also use <br> in the asciidoc system, so it would migrate over nicely.

@bmorelli25 bmorelli25 added authoring Relates to our markdown parser enhancement labels Jan 23, 2025
@reakaleek reakaleek self-assigned this Jan 24, 2025
@reakaleek
Copy link
Member

reakaleek commented Jan 24, 2025

I'm not sure if we can add a custom implementation for this.

I found that to be able to support this natively we need to remove the .DisableHtml() method at https://github.com/elastic/docs-builder/blob/main/src/Elastic.Markdown/Myst/MarkdownParser.cs#L55

@Mpdreamz WDYT?

What was the reason for the decision to disable html?

P.S.
I understood now that we can extend e.g. the HtmlBlockParser

@Mpdreamz
Copy link
Member

We want to be prescriptive with styling and layout so therefor we'll never allow html.

To support the br tag in isolated we need to create a new inline markdown parser that injects it to the markdown AST as its own leaf element.

Then we can render it like all the other markdown constructs and write the br html element.

@reakaleek
Copy link
Member

Thank you for the hint @Mpdreamz.

Will be fixed by #342

@reakaleek
Copy link
Member

It's merged now and will be in the next release.

One note, it only supports exactly <br>.

<br/> will not work and will be rendered as text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
authoring Relates to our markdown parser enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants