Skip to content

Conversation

@stevejgordon
Copy link
Contributor

Exclude matching \r\n

When generating docs locally, on Windows, after running the tool, all files which include callouts then showed as modified, making review very difficult. I noticed that some of the callouts only included a newline (\n) and were missing the carriage return (\r).

Upon investigation, I found that the regex used for callout replacement was catching and removing the \r character. This change fixes the two places such replacement may occur and ensures we stop matching before the \r\n.

I'm not super hot on Regex so welcome opinions on the approach!

When generating docs locally I noticed that some of the callouts only
included a newline and were missing the carriage return. Upon
investigation, I found that the regex used for callout replacement was
catching and removing the \r character.

This change fixes the two places such replacement may occur and ensures
we stop matching before the \r\n.
@stevejgordon stevejgordon merged commit a74c510 into master Nov 20, 2020
@stevejgordon stevejgordon deleted the bug/docs-generator branch November 20, 2020 21:15
github-actions bot pushed a commit that referenced this pull request Nov 20, 2020
When generating docs locally I noticed that some of the callouts only
included a newline and were missing the carriage return. Upon
investigation, I found that the regex used for callout replacement was
catching and removing the \r character.

This change fixes the two places such replacement may occur and ensures
we stop matching before the \r\n.
github-actions bot pushed a commit that referenced this pull request Nov 20, 2020
When generating docs locally I noticed that some of the callouts only
included a newline and were missing the carriage return. Upon
investigation, I found that the regex used for callout replacement was
catching and removing the \r character.

This change fixes the two places such replacement may occur and ensures
we stop matching before the \r\n.
stevejgordon added a commit that referenced this pull request Nov 23, 2020
When generating docs locally I noticed that some of the callouts only
included a newline and were missing the carriage return. Upon
investigation, I found that the regex used for callout replacement was
catching and removing the \r character.

This change fixes the two places such replacement may occur and ensures
we stop matching before the \r\n.

Co-authored-by: Steve Gordon <sgordon@hotmail.co.uk>
stevejgordon added a commit that referenced this pull request Nov 23, 2020
When generating docs locally I noticed that some of the callouts only
included a newline and were missing the carriage return. Upon
investigation, I found that the regex used for callout replacement was
catching and removing the \r character.

This change fixes the two places such replacement may occur and ensures
we stop matching before the \r\n.

Co-authored-by: Steve Gordon <sgordon@hotmail.co.uk>
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.

3 participants