Sublime Forum

HTML sublime syntax : wrong scope name for table's tags

#1

Hy everybody,

I just realize that HTM syntax has potentially errors in scope naming.
(I dont’t know where i have to write this)

When i write tags in html files for tables (e.g. table, tr, th, …), the scope name defined is .inline. :
text.html.basic meta.tag.inline.table.html entity.name.tag.inline.table.html

I suppose this is an error because these tags are block tags.
If i’m right, is it possible to correct this as soon as possible please ?

I write sublime plugin using scope names and i would like to exclude the scope containing inline.
Unfortunatly, my plugin does not run correctly because of this.

Thank’s for your help.

0 Likes

#2

Syntax definitions are developed at https://github.com/sublimehq/Packages.

Current tag scopes are a relic from early days when ST primarily used good old TextMate syntax. Some choises are indeed a bit strange.

A RFC about possible tag naming can be found at https://github.com/sublimehq/Packages/issues/2772

0 Likes

#3

A PR with some improvements can be found at https://github.com/sublimehq/Packages/pull/3420

0 Likes

#4

Thank’s a lot.
I learn more and more how the project run.

Actually, i modified in my sublime / packages the lines below in HTML.sublime-syntax :

    - match: (</?)((?i:col|colgroup|table|tbody|td|tfoot|th|thead|tr){{tag_name_break}})
      captures:
        1: punctuation.definition.tag.begin.html
        2: entity.name.tag.**block**.table.html
      push:
        - meta_scope: meta.tag.**block**.table.html
        - include: tag-end-maybe-self-closing
        - include: tag-attributes

Have a nice week end.

0 Likes