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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix edge case where period after a link gets escaped #46

Merged
merged 2 commits into from Mar 11, 2019

Conversation

Projects
None yet
2 participants
@tianon
Copy link
Contributor

tianon commented Feb 8, 2019

Before:

Lorem [ipsum](http://example.com)\.

After:

Lorem [ipsum](http://example.com).

This one's been bothering me for ages but I never manged to track it down until today! 馃槃

(Thanks for writing such a great tool. 鉂わ笍)

Fix edge case where period after a link gets escaped
Before:

```markdown
Lorem [ipsum](http://example.com)\.
```

After:

```markdown
Lorem [ipsum](http://example.com).
```
@dmitshur

This comment has been minimized.

Copy link
Member

dmitshur commented Mar 11, 2019

Hi, thanks for the PR, and sorry about the delay.

I can't reproduce it. When I run markdownfmt (the current version, without this patch) on the "Before" input, I get the same output back.

Can you please provide a test case where the backslash gets added?

Edit: Oh, whoops, I was testing it on the "After" output, thinking that the problem was that it'd add a backslash unnecessarily. But the actual problem was that it doesn't remove the unneeded backslash.

add test case
To prevent regressions.

@dmitshur dmitshur force-pushed the tianon:fix-period branch from 266c4eb to 6ff2bba Mar 11, 2019

@dmitshur dmitshur merged commit b3016f8 into shurcooL:master Mar 11, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@tianon tianon deleted the tianon:fix-period branch Mar 11, 2019

@tianon

This comment has been minimized.

Copy link
Contributor Author

tianon commented Mar 11, 2019

Yeah; is there more you want me to try and do here, or is this good enough? Happy to help out more if there's something I can do better here. 馃槄 鉂わ笍

@dmitshur

This comment has been minimized.

Copy link
Member

dmitshur commented Mar 12, 2019

If there are additional test cases I haven't considered, it'd be helpful if you could share those. If the one I added covers this problem fully, then there's nothing more to do here.

Thanks again for the fix!

@tianon

This comment has been minimized.

Copy link
Contributor Author

tianon commented Mar 12, 2019

I think that should cover it; if I run across more I'll be back with more test cases. 馃槄馃憤

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.