emmet-vim icon indicating copy to clipboard operation
emmet-vim copied to clipboard

Update URL regular expression for anchorizeURL to include parenthetical subtopics from wikipedia

Open SkyLeach opened this issue 4 years ago • 0 comments

I often use the emmet-quoted-text-url (default mapping of <C-y>A) to provide a hint to blog readers.

A large percentage of these blockquotes involve wikipedia and wikipedia encodes lexical contextual encapsulation parenthetically. Here is an example url: https://en.wikipedia.org/wiki/Lint_(software).

Here is what happens due to the current URL parsing:

Tools like this in computer science are known as linters (see: <blockquote class="quote">
<a href="https://en.wikipedia.org/wiki/Lint_">Lint - Wikipedia</a>
<br>
<p>Places [ edit ] Lint, Belgium , a municipality located in Antwerp, Belgium Linț, a village in Chețan...</p>
<cite>https://en.wikipedia.org/wiki/Lint_</cite>
</blockquote>
(software) )

As you can see, the top-level contextual definition (usually the first term defined on wikipedia) is the one returned because the parenthesis are excluded from the URL.

I think I could update the regex and issue a PR but wanted to make sure this was in line with the project philosophy before doing so. The regex in question is (I believe) inside of /autoload/emmet.vim on line 860 (linked).

SkyLeach avatar Nov 26 '20 03:11 SkyLeach