d-ogarkov / jekyll-extlinks

This Jekyll plugin adds custom attributes (rel="nofollow", target="_blank", etc.) to external links in your content.
MIT License
19 stars 8 forks source link

Issues with use of Vue/AlpineJS shorthand syntax #10

Open kslstn opened 2 years ago

kslstn commented 2 years ago

With extlinks enabled, templates with @ are not built properly: angular brackets can be converted to > and <. What's worse is that when there's also a > in an attribute's value, parts of the template are left out.

Example 1

<button @click="doSomething()">Label</button>

Becomes:

<button>Label</button>

Example 2

<button @click="if (foo>0) doSomething()">Label</button>

Becomes:

<button>0) doSomething()"&gt;Label</button>

Example 3

<button @click="if (foo < 0) doSomething()">Label</button>

Becomes:

<button dosomething>Label</button>

Example 4

<button
  @keydown.arrow-up.prevent="if(foo < bar foo++"
  @keydown.arrow-down.prevent="if(foo > fiz) foo--"
>

Becomes

<button foo> fiz) foo--"
&gt;
kslstn commented 2 years ago

Additional info: it seems like there needs to be a link in the template for the error to occur:

<a href="#">A link</a>