Skip to content

Commit c6967c5

Browse files
committed
Better table syntax
1 parent 1f463ec commit c6967c5

File tree

1 file changed

+28
-12
lines changed

1 file changed

+28
-12
lines changed

syntaxes/wikitext.tmLanguage.yaml

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -389,17 +389,28 @@ repository:
389389
patterns:
390390
- include: $self
391391
- name: meta.tag.block.table-row.wikitext
392-
begin: '^\s*(\|-)\s*'
393-
# 1 |- 1
394-
end: $
395-
beginCaptures:
392+
match: '^\s*(\|-)\s*(.*)$'
393+
captures:
396394
1:
397395
name: punctuation.definition.tag.begin.wikitext
398-
patterns:
399-
- include: $self
400-
- include: text.html.basic#attribute
401-
- name: invalid.illegal.bad-table-context.wikitext
402-
match: '\|.*'
396+
2:
397+
patterns:
398+
- include: $self
399+
- name: invalid.illegal.bad-table-context.wikitext
400+
match: '\|.*'
401+
- include: text.html.basic#attribute
402+
# - name: meta.tag.block.table-row.wikitext
403+
# begin: '^\s*(\|-)\s*'
404+
# # 1 |- 1
405+
# end: $
406+
# beginCaptures:
407+
# 1:
408+
# name: punctuation.definition.tag.begin.wikitext
409+
# patterns:
410+
# - include: $self
411+
# - include: text.html.basic#attribute
412+
# - name: invalid.illegal.bad-table-context.wikitext
413+
# match: '\|.*'
403414
- name: meta.tag.block.th.heading
404415
begin: ^\s*(!)(([^\[]*?)(\|))?(.*?)(?=(!!)|$)
405416
# 1!123 any 34 |42 5bdy5 !!
@@ -425,8 +436,8 @@ repository:
425436
name: punctuation.definition.tag.begin.wikitext
426437
3:
427438
patterns:
428-
- include: text.html.basic#attribute
429439
- include: $self
440+
- include: text.html.basic#attribute
430441
4:
431442
name: punctuation.definition.tag.wikitext
432443
5:
@@ -442,13 +453,18 @@ repository:
442453
end: $
443454
patterns:
444455
- include: $self
445-
- begin: ^\s*(\|)
456+
- begin: ^\s*(\|)(([^\[]*?)((?<!\|)\|(?!\|)))?
446457
# name: string.quoted.wikitext
447458
end: $
448459
beginCaptures:
449460
1:
450461
name: punctuation.definition.tag.wikitext
451-
# 2:
462+
3:
463+
patterns:
464+
- include: $self
465+
- include: text.html.basic#attribute
466+
4:
467+
name: punctuation.definition.tag.wikitext
452468
# patterns:
453469
# - include: text.html.basic#attribute
454470
# 3:

0 commit comments

Comments
 (0)