martanne / vis

A vi-like editor based on Plan 9's structural regular expressions
Other
4.2k stars 258 forks source link

lexers/html: detect script type "module" #965

Closed benhormann closed 1 year ago

benhormann commented 2 years ago

In theory it could be <script type=module> (without quotes), hence (["\']?). Edit: Hmm, (["\']?) doesn't seem to work (for unquoted, quoted is fine).

So maybe something like this would be better:

  local _, _, _, script_type = input:find('^%s+type%s*=%s*(["\'])(^["\']+)%1', index)
  if script_type == 'text/javascript' or script_type == 'module' then
mcepl commented 1 year ago

Lexers are not maintained as part of vis any more, please, push this ticket to https://github.com/orbitalquark/scintillua/issues. Thank you.