{ "comment": "\n\t\tTODO: language\n\t\t 1. Add a bunch of HTML tags. See the #block and #style sections.\n\t\t 2. Correctly scope all the parser functions and their contents.\n\t\t This on will be complicated, as there are several: expr, if, etc.\n\t\t 3. Get some kind of folding by heading (Not possible with TM1 rules).\n\t\t 4. Make sure that illegal things are correctly scoped illegal.\n\t\t This is non-trivial, and has several parts\n\t\t - Bold/italic are based on brain-dead heuristics. Also, we should\n\t\t scope as illegal when for instance a new heading starts\n\t\t before an italic has been closed.\n\t\t - Templates... these will be pretty tough as they are flexible.\n\t\t 5. tag. Not sure this one is worth the effort\n\n\t\t 6. Figure out a better scope for meta.function-call. Infininight\n\t\t suggests entity.name.function.call, to be paralleled by\n\t\t entity.name.function.definition. I am not completely sure I like\n\t\t that solution, but it is probably better than meta.function-call\n\n\t\tTODO snippets and commands\n\t\t 1. Add a drop command (and keyboard shortcuts) for links/images\n\t\t 2. Make sure all the preference items are sorted out, for instance\n\t\t smart typing pairs, indent patterns, etc.\n\t\t 3. Command: big/small\n\t\t\n\t\tFINISHED:\n\t\t 1. Add support for LaTeX math mode inside of tags.\n\t\t 2. Add a command for new list item. This one is trivial\n\t\t 3. Get the symbol list working on headings. Trivial.\n\t\t 4. tag. This one adds some complication, but\n\t\t is worth supporting.\n\t\t 5. commands for bold/italic (tbates)\n\t\t 6. All lists scoped by type of list. (tbates)\n\t", "fileTypes": [ "mediawiki", "wikipedia", "wiki" ], "keyEquivalent": "^~M", "name": "Mediawiki", "patterns": [ { "include": "#block" }, { "include": "#inline" } ], "repository": { "block": { "patterns": [ { "begin": "^\\s*(?i)(#redirect)", "beginCaptures": { "1": { "name": "keyword.control.redirect.mediawiki" } }, "end": "\\n", "name": "meta.redirect.mediawiki", "patterns": [ { "include": "#link" } ] }, { "begin": " ?(<)(source)[ \\t]+(lang)(=)(\"[^\"]+\")(>)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.mediawiki" }, "2": { "name": "storage.type.mediawiki" }, "3": { "name": "storage.type.mediawiki" }, "4": { "name": "punctuation.section.mediawiki" }, "5": { "name": "string.quoted.mediawiki" }, "6": { "name": "punctuation.definition.tag.mediawiki" } }, "comment": "source: ", "end": " ?()", "endCaptures": { "1": { "name": "punctuation.definition.tag.mediawiki" }, "2": { "name": "storage.type.mediawiki" }, "3": { "name": "punctuation.definition.tag.mediawiki" } }, "name": "meta.tag.source.mediawiki", "patterns": [ { "include": "#tag-stuff" } ] }, { "captures": { "1": { "name": "punctuation.definition.heading.mediawiki" }, "2": { "name": "entity.name.section.mediawiki" }, "3": { "patterns": [ { "match": "=+$", "name": "invalid.illegal.extra-equals-sign.mediawiki" }, { "include": "#inline" } ] }, "4": { "name": "punctuation.definition.heading.mediawiki" } }, "match": "^(={1,6})(?!=)((.+))(\\1)\\s*$\\n?", "name": "markup.heading.${1/=(?=)?(?=)?(?=)?(?=)?(?=)?/${f:?6:${e:?5:${d:?4:${c:?3:${b:?2:1}}}}}/}.mediawiki" }, { "comment": "\n\t\t\t\t\t\tA separator is made up of 4 or more -s alone on a\n\t\t\t\t\t\tline by themselves.\n\t\t\t\t\t", "match": "^-{4,}[ \\t]*($\\n)?", "name": "meta.separator.mediawiki" }, { "begin": "^ (?=\\s*\\S)", "comment": "\n\t\t\t\t\t\tCode blocks start with one space. Wiki text and\n\t\t\t\t\t\thtml are still interpreted in MediaWiki, unlike in\n\t\t\t\t\t\tmediawiki.\n\t\t\t\t\t", "end": "^(?=[^ ])", "name": "markup.raw.block.mediawiki", "patterns": [ { "include": "#inline" } ] }, { "begin": "^([#:;])", "comment": "\n\t\t\t\t\t\tneed to scope nested lists\n\t\t\t\t\t\t - need to cope with \n definition lists (; :)\n\t\t\t\t\t\t indented paragraphs, as used on talk pages (:)\n\t\t\t\t\t", "end": "^(?!\\1)", "name": "markup.list.numbered.mediawiki", "patterns": [ { "include": "#inline" } ] }, { "begin": "^([*])", "comment": "unordered list", "end": "^(?!\\1)", "name": "markup.list.unnumbered.mediawiki", "patterns": [ { "include": "#inline" } ] }, { "include": "#table" }, { "include": "#comments" }, { "begin": "^(?![\\t ;*#:=]|----|$)", "comment": "\n\t\t\t\t\t\tAnything that is not a code block, list, header, etc.\n\t\t\t\t\t\tis a paragraph.\n\t\t\t\t\t", "end": "^(?:\\s*$|(?=[;*#:=]|----))", "name": "meta.paragraph.mediawiki", "patterns": [ { "include": "#inline" } ] } ] }, "block_html": { "comment": "\n\t\t\t\tThe available block HTML tags supported are:\n\t\t\t\t * blockquote, center, pre, div, hr, p\n\t\t\t\t * tables: table, th, tr, td, caption\n\t\t\t\t * lists: ul, ol, li\n\t\t\t\t * definition lists: dl, dt, dd\n\t\t\t\t * headers: h1, h2, h3, h4, h5, h6\n\t\t\t\t * br\n\t\t\t", "patterns": [ { "begin": "()", "captures": { "0": { "name": "punctuation.section.embedded.tex.math" }, "1": { "name": "meta.tag.inline.math.mediawiki" }, "2": { "name": "source.tex.math" } }, "contentName": "source.tex.math", "end": "((<)/math>)", "name": "meta.embedded.tex.math", "patterns": [ { "include": "text.tex#math" } ] }, { "begin": "]*>", "contentName": "source.html", "end": "", "name": "meta.embedded.html.table", "patterns": [ { "include": "text.html.basic" } ] }, { "begin": "(<)(ref)(>)", "beginCaptures": { "1": { "name": "meta.tag.inline.ref.mediawiki" }, "2": { "name": "entity.name.tag.ref.mediawiki" }, "3": { "name": "meta.tag.inline.ref.mediawiki" } }, "comment": "content TODO: Redundant with named tag", "contentName": "meta.reference.content.mediawiki", "end": "()", "endCaptures": { "1": { "name": "meta.tag.inline.ref.mediawiki" }, "2": { "name": "entity.name.tag.ref.mediawiki" }, "3": { "name": "meta.tag.inline.ref.mediawiki" } }, "name": "meta.reference.mediawiki", "patterns": [ { "include": "#inline" } ] }, { "captures": { "1": { "name": "meta.tag.inline.ref.mediawiki" }, "2": { "name": "entity.name.tag.ref.mediawiki" }, "4": { "name": "entity.name.tag.name.mediawiki" }, "5": { "name": "meta.tag.inline.ref.mediawiki" }, "6": { "name": "string.quoted.ref.name.mediawiki" }, "7": { "name": "meta.tag.inline.ref.mediawiki" } }, "comment": "", "match": "(<)(ref) *((name) *(=) *([^>]*))(/>)", "name": "meta.reference.named.cite.mediawiki" }, { "begin": "(<)(ref) *((name) *(=) *([^>]*))(>)", "beginCaptures": { "1": { "name": "meta.tag.inline.ref.mediawiki" }, "2": { "name": "entity.name.tag.ref.mediawiki" }, "4": { "name": "entity.name.tag.name.mediawiki" }, "5": { "name": "meta.tag.inline.ref.mediawiki" }, "6": { "name": "string.quoted.ref.name.mediawiki" }, "7": { "name": "meta.tag.inline.ref.mediawiki" } }, "comment": "content", "contentName": "meta.reference.content.labelled.mediawiki", "end": "()", "endCaptures": { "1": { "name": "meta.tag.inline.ref.mediawiki" } }, "patterns": [ { "include": "#inline" } ] }, { "begin": "()", "captures": { "1": { "name": "meta.tag.inline.ref.mediawiki" } }, "contentName": "meta.gallery.mediawiki", "end": "()", "patterns": [ { "begin": "(?x)\n\t\t\t\t\t\t\t\t^(?!\\s*\\n)\t # not an empty line\n\t\t\t\t\t\t\t\t( [ ]*(((i|I)mage)(:)) # spaces, image, colon\n\t\t\t\t\t\t\t\t ([^\\[\\]|]+) # anything\n\t\t\t\t\t\t\t\t (?", "name": "comment.block.html.mediawiki", "patterns": [ { "match": "--", "name": "invalid.illegal.bad-comments-or-CDATA.html.mediawiki" } ] } ] }, "entities": { "comment": "\n\t\t\t\tMediawiki supports Unicode, so these should not usually be\n\t\t\t\tnecessary, but they do show up on pages from time to time.\n\t\t\t", "patterns": [ { "match": "&([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);", "name": "constant.character.entity.html.mediawiki" }, { "match": "&", "name": "invalid.illegal.bad-ampersand.html.mediawiki" } ] }, "inline": { "patterns": [ { "captures": { "1": { "name": "constant.other.date-time.mediawiki" }, "2": { "name": "invalid.illegal.too-many-tildes.mediawiki" } }, "match": "(~~~~~)(~{0,2})(?!~)" }, { "comment": "3 ~s for sig, 4 for sig + timestamp", "match": "~~~~?", "name": "constant.other.signature.mediawiki" }, { "include": "#link" }, { "include": "#style" }, { "include": "#table" }, { "include": "#template" }, { "include": "#block_html" }, { "include": "#comments" } ] }, "link": { "patterns": [ { "applyEndPatternLast": 1, "begin": "(?x:\n\t\t\t\t\t\t(\\[\\[) # opening brackets\n\t\t\t\t\t\t ( [ ]*(((i|I)mage)(:)) # spaces, image, colon\n\t\t\t\t\t\t ([^\\[\\]|]+) # anything\n\t\t\t\t\t\t (?)", "captures": { "1": { "name": "meta.tag.inline.bold.html.mediawiki" } }, "contentName": "markup.bold.html.mediawiki", "end": "()", "patterns": [ { "include": "#inline" } ] }, { "begin": "(<(i|em)>)", "captures": { "1": { "name": "meta.tag.inline.italic.html.mediawiki" } }, "contentName": "markup.italic.html.mediawiki", "end": "()", "patterns": [ { "include": "#inline" } ] }, { "begin": "(<(s|strike)>)", "captures": { "1": { "name": "meta.tag.inline.strikethrough.html.mediawiki" } }, "contentName": "markup.other.strikethrough.html.mediawiki", "end": "()", "patterns": [ { "include": "#inline" } ] }, { "begin": "(<(u)>)", "captures": { "1": { "name": "meta.tag.inline.underline.html.mediawiki" } }, "contentName": "markup.underline.html.mediawiki", "end": "()", "patterns": [ { "include": "#inline" } ] }, { "begin": "(<(tt|code)>)", "captures": { "1": { "name": "meta.tag.inline.raw.html.mediawiki" } }, "contentName": "markup.raw.html.mediawiki", "end": "()", "patterns": [ { "include": "#inline" } ] }, { "begin": "(<(big|small|sub|sup)>)", "captures": { "1": { "name": "meta.tag.inline.any.html.mediawiki" } }, "contentName": "markup.other.inline-styles.html.mediawiki", "end": "()", "patterns": [ { "include": "#inline" } ] } ] }, "style_in_link": { "patterns": [ { "begin": "'''", "end": "'''", "name": "markup.bold.mediawiki", "patterns": [ { "include": "#style_in_link" } ] }, { "begin": "''", "end": "''", "name": "markup.italic.mediawiki", "patterns": [ { "include": "#style_in_link" } ] }, { "begin": "(<(b|strong)>)", "captures": { "1": { "name": "meta.tag.inline.bold.html.mediawiki" } }, "contentName": "markup.bold.html.mediawiki", "end": "()", "patterns": [ { "include": "#style_in_link" } ] }, { "begin": "(<(i|em)>)", "captures": { "1": { "name": "meta.tag.inline.italic.html.mediawiki" } }, "contentName": "markup.italic.html.mediawiki", "end": "()", "patterns": [ { "include": "#style_in_link" } ] }, { "begin": "(<(s|strike)>)", "captures": { "1": { "name": "meta.tag.inline.strikethrough.html.mediawiki" } }, "contentName": "markup.other.strikethrough.html.mediawiki", "end": "()", "patterns": [ { "include": "#style_in_link" } ] }, { "begin": "(<(u)>)", "captures": { "1": { "name": "meta.tag.inline.underline.html.mediawiki" } }, "contentName": "markup.underline.html.mediawiki", "end": "()", "patterns": [ { "include": "#style_in_link" } ] }, { "begin": "(<(tt|code)>)", "captures": { "1": { "name": "meta.tag.inline.raw.html.mediawiki" } }, "contentName": "markup.raw.html.mediawiki", "end": "()", "patterns": [ { "include": "#style_in_link" } ] }, { "begin": "(<(big|small|sub|sup)>)", "captures": { "1": { "name": "meta.tag.inline.any.html.mediawiki" } }, "contentName": "markup.other.inline-styles.html.mediawiki", "end": "()", "patterns": [ { "include": "#style_in_link" } ] }, { "include": "#comments" } ] }, "table": { "patterns": [ { "begin": "^({\\|)", "beginCaptures": { "1": { "name": "meta.tag.inline.table.mediawiki" } }, "comment": "TODO: add styling capabilities", "end": "(^\\|})", "endCaptures": { "1": { "name": "meta.tag.inline.table.mediawiki" } }, "name": "markup.other.table.mediawiki", "patterns": [ { "captures": { "1": { "name": "meta.tag.inline.table.caption.mediawiki" }, "2": { "name": "variable.parameter.name.string.mediawiki" } }, "match": "^(\\|\\+)[\\t ]*(.*)$", "name": "meta.table.caption.mediawiki" }, { "begin": "^\\|-", "beginCaptures": { "1": { "name": "meta.tag.inline.table.mediawiki" } }, "comment": "TODO: allow selection of rows; move row up/down, etc.", "end": "^(?=\\|-|^\\|})", "name": "markup.other.table.row.mediawiki", "patterns": [ { "include": "#inline" } ] }, { "captures": { "1": { "name": "meta.tag.inline.table.cellwall.mediawiki" }, "2": { "name": "string.other.table.cellcontents.mediawiki" } }, "match": "(^\\||\\|\\|) *([^\\|]*) *", "name": "meta.table.cell.mediawiki" }, { "include": "#inline" } ] } ] }, "template": { "comment": "\n\t\t\t\tThis repository item covers templates and parser functions.\n\t\t\t", "patterns": [ { "captures": { "1": { "name": "variable.parameter.template.numeric.mediawiki" } }, "match": "{{{[ ]*([0-9]+)[ ]*}}}", "name": "meta.template-parameter.mediawiki" }, { "captures": { "1": { "name": "variable.parameter.template.named.mediawiki" } }, "match": "{{{[ ]*(.*?)[ ]*}}}", "name": "meta.template-parameter.mediawiki" }, { "begin": "({{)(?=[ ]*#)", "beginCaptures": { "1": { "name": "meta.tag.inline.template.mediawiki" }, "2": { "name": "meta.function-call.template.mediawiki" } }, "comment": "\n\t\t\t\t\t\tWhy oh why did mediawiki have to add these??\n\t\t\t\t\t", "end": "(}})", "endCaptures": { "1": { "name": "meta.tag.inline.template.mediawiki" } }, "name": "meta.template.parser-function.mediawiki", "patterns": [ { "include": "#inline" } ] }, { "begin": "({{)([^{}\\|]+)?", "beginCaptures": { "1": { "name": "meta.tag.inline.template.mediawiki" }, "2": { "name": "meta.function-call.template.mediawiki" } }, "comment": "scope as meta.function-call as the closest thing to a template with parameters, etc.", "end": "(}})", "endCaptures": { "1": { "name": "meta.tag.inline.template.mediawiki" } }, "name": "meta.template.mediawiki", "patterns": [ { "include": "#comments" }, { "begin": "(\\|)\\s*(=)", "beginCaptures": { "1": { "name": "punctuation.fix_this_later.pipe.mediawiki" }, "2": { "name": "punctuation.fix_this_later.equals-sign.mediawiki" } }, "contentName": "comment.block.template-hack.mediawiki", "end": "(?=[|}])" }, { "begin": "(\\|)(([^{}\\|=]+)(=))?", "beginCaptures": { "1": { "name": "punctuation.fix_this_later.pipe.mediawiki" }, "2": { "name": "variable.parameter.template.mediawiki" }, "3": { "name": "punctuation.fix_this_later.equals-sign.mediawiki" } }, "contentName": "meta.value.template.mediawiki", "end": "(?=[|}])", "patterns": [ { "include": "#inline" } ] }, { "match": "\\|", "name": "punctuation.fix_this_later.pipe.mediawiki" } ] } ] } }, "scopeName": "text.html.mediawiki", "uuid": "6AF21ADF-316A-47D1-A8B6-1BB38637DE9A" }