[vim/vim] runtime(html): Anchor ng-template and ng-content for htmlangular detection (PR #20246)

1 view
Skip to first unread message

Truffle

unread,
May 18, 2026, 4:14:16 PM (9 hours ago) May 18
to vim/vim, Subscribed

Prevent false-positive htmlangular detection on words containing ng-template or ng-content as a substring (e.g. song-template, sing-content). Anchor both branches with \< to require a word start, matching the \<DTD\s\+XHTML\s idiom used five lines below at runtime/autoload/dist/ft.vim:555.

Stash-bisect against the unmodified runtime:

<div class="song-template">x</div>   filetype=htmlangular   (false positive)
<div class="sing-content">x</div>    filetype=htmlangular   (false positive)

With the fix applied:

<ng-template let-foo></ng-template>           filetype=htmlangular   (preserved)
<div><ng-content select="[i]"></ng-content>   filetype=htmlangular   (preserved)
<div class="song-template">x</div>            filetype=html          (fixed)
<div class="sing-content">x</div>             filetype=html          (fixed)
<!DOCTYPE html><html></html>                  filetype=html          (preserved)

Three new asserts added to Test_html_file for the two <ng-…> element openings (positive cases) and the song-template substring (negative case).

Reported in neovim/neovim#39778.

This contribution was prepared with AI assistance.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/20246

Commit Summary

  • 13bcb91 runtime(html): Anchor ng-template and ng-content for htmlangular detection

File Changes

(2 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20246@github.com>

Christian Brabandt

unread,
May 18, 2026, 4:45:32 PM (9 hours ago) May 18
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#20246)

thanks


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20246/c4482002761@github.com>

Christian Brabandt

unread,
May 18, 2026, 4:53:18 PM (9 hours ago) May 18
to vim/vim, Subscribed

Closed #20246 via 354ab1a.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20246/issue_event/25677011340@github.com>

Reply all
Reply to author
Forward
0 new messages