Skip to content

Trailing non-breaking space not caught by trailing whitespace detection #250

@oliverguenther

Description

@oliverguenther

I'm not sure If I have overlooked an option or a discussion where this was talked about in the past, but whenever an inline style has a trailing (or leading) nbsp whitespace, the resulting commonmark is invalid since its no longer a flanking run.

For example, this HTML

  <strong>bold&nbsp;</strong>

results in the following string

**bold **

http://jsfiddle.net/29hqet7s/6/

This appears to be related to both #222 and #102.

I'm wondering what the expected result should be. I would expect it to either output the entity or strip it. On the latter issue you mentioned this exact issue regarding trailing whitespace, so I would assume this is the expected behavior? I would like to send a PR for either option (possibly behind a flag?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions