1

私はバグに少しかじられました

 <link rel=stylesheet" type="text/css" href="stylesheet.css" media="all">

それよりも

 <link rel="stylesheet" type="text/css" href="stylesheet.css" media="all">

html の vim の構文強調表示では、この 2 つが区別されないようです。どこかから取得できるより厳密な構文ファイルはありますか?

(そして嫌いな人のために:vimの質問はスーパーユーザーではなくstackoverflowに属します

4

1 に答える 1

0

その場しのぎの手段として、のコピーを入れて$VIMRUNTIME/syntax/html.vim変更~/.vim/syntax/html.vimしました。

38c38
< syn match   htmlValue    contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1   contains=javaScriptExpression,@htmlPreproc
---
> syn match   htmlValue    contained /=[\t ]*\%('\%(\\.\|[^\\']\)*'\|"\%(\\.\|[^\\"]\)*\|[^'" \t>]*\)/hs=s+1   contains=htmlString,javaScriptExpression,@htmlPreproc
40c40
< syn region  htmlTag                start=+<[^/]+   end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster
---
> syn region  htmlTag                start=+<[^/]+   end=+>+ contains=htmlTagN,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster
43a44
> syn match   htmlTagError contained /['"].*/
168c169
<   syn region  htmlScriptTag     contained start=+<script+ end=+>+       contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent
---
>   syn region  htmlScriptTag     contained start=+<script+ end=+>+       contains=htmlTagN,htmlArg,htmlValue,htmlTagError,htmlEvent

これはこの特定のエラー (引用符の不一致) をキャッチするだけなので、厳密な html のより良い構文ファイルにまだ非常に興味があります。

于 2011-05-02T21:50:36.737 に答える