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

Ampersands cause content to be skipped #192

Closed
marijnvdwerf opened this issue Oct 12, 2015 · 2 comments · Fixed by #194
Closed

Ampersands cause content to be skipped #192

marijnvdwerf opened this issue Oct 12, 2015 · 2 comments · Fixed by #194
Labels
bug Something isn't working right up-for-grabs Please feel free to take this one!

Comments

@marijnvdwerf
Copy link
Contributor

Non-entity ampersands followed by a later entity-indicating ampersand cause pieces of content to be skipped

Input:

> According to the ranking, Samsung has increased R&D spending to a whopping $13.4 billion
> this year from $10.4 billion last year **while Intel spent a not-too-shabby
> $10.6 billion, up from the $10.1 billion spent last year.**  This far exceeds the
> only other two major technology companies who made the list, IBM and Cisco, who
> invested a relatively weak $6.9 billion and $5.9 billion respectively.

Actual:

<blockquote>
<p>According to the ranking, Samsung has increased R This far exceeds the only other two
major technology companies who made the list, IBM and Cisco, who invested a relatively weak
$6.9 billion and $5.9 billion respectively.</p>
</blockquote>

Expected:

<blockquote><p>According to the ranking, Samsung has increased R&amp;D spending to a
whopping $13.4 billion this year from $10.4 billion last year <strong>while Intel spent
a not-too-shabby $10.6 billion, up from the $10.1 billion spent last year.</strong>
&#xA0;This far exceeds the only other two major technology companies who made the list, IBM
    and Cisco, who invested a relatively weak $6.9 billion and $5.9 billion respectively.
</blockquote>
@colinodell colinodell added bug Something isn't working right up-for-grabs Please feel free to take this one! labels Oct 12, 2015
@colinodell
Copy link
Member

My gut says this is probably an issue with the EntityParser's regex being too greedy. (Note how it starts at the first ampersand and continues through the &nbsp;).

@marijnvdwerf
Copy link
Contributor Author

Could it be as simple as a missing ^?

colinodell added a commit that referenced this issue Oct 13, 2015
This change allows us to create full regex patterns to match any entity, or
specifically one at the very start of the string.  This fixes an issue
introduced while trying to fix #192.
colinodell added a commit that referenced this issue Oct 13, 2015
This change allows us to create full regex patterns to match any entity, or
specifically one at the very start of the string.  This fixes an issue
introduced while trying to fix #192.
marijnvdwerf pushed a commit to marijnvdwerf/commonmark that referenced this issue Jan 5, 2016
This change allows us to create full regex patterns to match any entity, or
specifically one at the very start of the string.  This fixes an issue
introduced while trying to fix thephpleague#192.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right up-for-grabs Please feel free to take this one!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants