Skip to content

Don't break Markdown from external sources#5713

Merged
bramkragten merged 3 commits intodevfrom
frenck-2020-0452
May 2, 2020
Merged

Don't break Markdown from external sources#5713
bramkragten merged 3 commits intodevfrom
frenck-2020-0452

Conversation

@frenck
Copy link
Copy Markdown
Member

@frenck frenck commented May 2, 2020

Proposed change

New lines in Markdown don't have meaning. In some cases, however, this is cool (e.g., comments on GitHub, or things like a Markdown Lovelace card).

In general, it is bad and not according to specification. Especially when loading Markdown from external sources.

This PR exposed the break option from marked in our ha-markdown component, allowing to disable this (not default) behavior in those cases.

Example Markdown:

Hello, this is a very long line,
please note the enter set in the previous line
should not be shown when rendered.

As a matter of fact, this example only contains
2 lines.

Before:

image

After:

image

Other resources still work as normal:

image

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@bramkragten bramkragten merged commit c3832d5 into dev May 2, 2020
@bramkragten bramkragten deleted the frenck-2020-0452 branch May 2, 2020 13:19
@bramkragten bramkragten mentioned this pull request May 5, 2020
@lock lock Bot locked and limited conversation to collaborators May 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants