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

improved matching for emph on words containing underscores #20

Open
cebe opened this issue Feb 16, 2014 · 5 comments
Open

improved matching for emph on words containing underscores #20

cebe opened this issue Feb 16, 2014 · 5 comments

Comments

@cebe
Copy link
Owner

cebe commented Feb 16, 2014

https://github.com/yiisoft/yii2/pull/2452/files

@cebe cebe added this to the 1.0.0 milestone Feb 16, 2014
@cebe cebe added the bug label Apr 26, 2014
@cebe
Copy link
Owner Author

cebe commented Apr 26, 2014

MD: ``compareAttribute the name of the attribute to be compared with. _(currentAttribute_repeat)_
Expected: `

compareAttribute the name of the attribute to be compared with. (currentAttribute_repeat)

`

@cebe cebe modified the milestones: 1.0.1, 1.0.0 Apr 26, 2014
@cebe cebe modified the milestones: 1.0.1, 1.0.2 Oct 25, 2014
@cebe
Copy link
Owner Author

cebe commented Nov 7, 2014

A solution to this needs to implement backtrack to see information about the characters before _.

http://johnmacfarlane.net/babelmark2/?normalize=1&text=%60compareAttribute%60+the+name+of+the+attribute+to+be+compared+with.+_%28currentAttribute_repeat%29_

@cebe cebe closed this as completed Nov 7, 2014
@cebe cebe reopened this Nov 7, 2014
@cebe cebe modified the milestones: 2.0, 1.0.2 Nov 7, 2014
@cebe cebe changed the title add test for this improved matching for emph on words containing underscores Nov 7, 2014
@cebe
Copy link
Owner Author

cebe commented Nov 7, 2014

A regex would have to match for a word boundary before the starting _ character. (?!\b)

@cebe
Copy link
Owner Author

cebe commented Nov 7, 2014

test cases:

MD:

`compareAttribute` the name of the attribute to be compared with. _(currentAttribute_repeat)_

`compareAttribute` the name of the attribute to be compared with. (_currentAttribute_repeat_)

_em_word_with_underscores_

expected:

<p><code>compareAttribute</code> the name of the attribute to be compared with. <em>(currentAttribute_repeat)</em></p>
<p><code>compareAttribute</code> the name of the attribute to be compared with. (<em>currentAttribute_repeat</em>)</p>
<p><em>em_word_with_underscores</em></p>

@cebe
Copy link
Owner Author

cebe commented Nov 28, 2014

Another case:

_one\_two_ __one\_two__

*one\*two* **one\*two**

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant