Skip to content

Commit

Permalink
ammend pull quote syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
robfrawley committed Jun 4, 2017
1 parent 72b23e0 commit 2f05eda
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/Plugin/InlinePullQuotePlugin.php
Expand Up @@ -35,7 +35,7 @@ public function marker(): string
*/
public function invoke(array $excerpt): ResultInterface
{
if (1 !== preg_match('{^\{(?<quote>[^\}\{]+)\}}', $excerpt['text'], $matches)) {
if (1 !== preg_match('{^\{>(?<quote>[^\}\{]+)\}}', $excerpt['text'], $matches)) {
return new EmptyResult();
}

Expand Down
5 changes: 3 additions & 2 deletions tests/Fixtures/markdown/extended/expected.html
Expand Up @@ -20,8 +20,9 @@ <h2 id="custom-id">Header 2</h2>
<p>This paragraph is special, as it contains a <span data-pull-quote="&quot;pull quote that will be given a special treatment by duplicating the content in a data-pull-link attribute&quot;">pull quote that will be given a special treatment by duplicating the
content in a data-pull-link attribute</span> which allows you to use special CSS to position the attribute content in whatever
pull quote style you'd like.</p>
<p>Alternatively, this paragraph should not cause a pull quote to be created with only an opening { and no closing bracket
closing it. Even more, you can escape the pull quote behavior {using a forward slash before the opening bracket}.</p>
<p>Alternatively, this paragraph should not cause a pull quote to be created with only an opening {&gt; and no closing bracket
closing it. Even more, you can escape the pull quote behavior {&gt;using a forward slash before the opening bracket}. Also,
brackets { without a greater than sign} don't cause pull quotes and escaping the greater than sign {> works as well.}</p>
<hr />
<dl>
<dt>Apple</dt>
Expand Down
7 changes: 4 additions & 3 deletions tests/Fixtures/markdown/extended/provided.md
Expand Up @@ -29,12 +29,13 @@ The HTML specification is maintained by the W3C.

An inline link https://src.run that should be transformed into a HTML hyperlink automatically.

This paragraph is special, as it contains a {pull quote that will be given a special treatment by duplicating the
This paragraph is special, as it contains a {>pull quote that will be given a special treatment by duplicating the
content in a data-pull-link attribute} which allows you to use special CSS to position the attribute content in whatever
pull quote style you'd like.

Alternatively, this paragraph should not cause a pull quote to be created with only an opening { and no closing bracket
closing it. Even more, you can escape the pull quote behavior \{using a forward slash before the opening bracket}.
Alternatively, this paragraph should not cause a pull quote to be created with only an opening {> and no closing bracket
closing it. Even more, you can escape the pull quote behavior \{>using a forward slash before the opening bracket}. Also,
brackets { without a greater than sign} don't cause pull quotes and escaping the greater than sign {\> works as well.}

---

Expand Down

0 comments on commit 2f05eda

Please sign in to comment.