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

Add failing spec for codeblock sanitization #1469

Merged
merged 1 commit into from
Oct 27, 2019
Merged

Conversation

greysteil
Copy link
Contributor

Codeblock sanitization is hard. This PR adds another (currently failing) spec for it.

Connected to #1427.

@greysteil
Copy link
Contributor Author

@pombeirp thanks for your work on #1427. Looks like it's broken the case where an inline code quote is closed implicitly by a line break. Any thoughts on a good way to fix?

@pedropombeiro
Copy link

@greysteil It looks like we can follow GitHub's rendering logic and avoid interpreting code fences which span a section separator (---) unless said code fence consists of 3 or more backticks. I'll see if I can look into it these next days (currently traveling back from vacation).

@pedropombeiro
Copy link

pedropombeiro commented Oct 27, 2019

For context, these are the specs we should base the logic on (we should add these links to the sanitizer code for reference):

GFM code spans
GFM fenced code block

The current logic does a good enough job for code blocks (although it can be tightened up), but there are issues with the implementation for code spans. Namely, empty lines cannot appear inside a code span, however the current regex allows for it causing the unit test to fail.

@greysteil greysteil merged commit 5a31efe into master Oct 27, 2019
@greysteil greysteil deleted the failing-sanitizer-spec branch October 27, 2019 17:08
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.

2 participants