Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Fix newlines in tabbed codeblocks #654

Merged
merged 5 commits into from
Apr 29, 2020
Merged

Conversation

rafegoldberg
Copy link
Contributor

@rafegoldberg rafegoldberg commented Apr 29, 2020

RegEx Demo

Changes

The changes we pushed yesterday broke recognition of code tabs with multiple sequential blank lines:

```
this
tab
worked
```
```
but this

one broke
```

Yeek! I'm updating the RegEx pattern and adding some new tests for this functionality.

Pattern Breakdown

image

Matching Groups Look Ahead
Match anything between opening and closing ``` tags from the start of the input. Extend match to the closing ``` tag followed by two new lines, or by a single new line that's not followed by an opening code tag itself, or to the end of the input string.

Jesus that's confusing to write out; fuckin’ RegEx, man...

@rafegoldberg rafegoldberg added type:bug Something isn't working Markdown labels Apr 29, 2020
@rafegoldberg rafegoldberg requested a review from erunion April 29, 2020 20:55
@rafegoldberg rafegoldberg marked this pull request as ready for review April 29, 2020 20:55
Copy link
Member

@erunion erunion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

@rafegoldberg rafegoldberg merged commit 3e75da6 into master Apr 29, 2020
@rafegoldberg rafegoldberg deleted the fix/rdmd-codetabs-pattern branch April 29, 2020 23:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants