| | 'comment' => '/(\/\/[^\r\n]*|\/\*.*?\*\/)/ms', |
| | 'string_interp' => '/(".*?"|""".*?""")/', |
| | - 'string' => '/(\'.*?\'|\'\'\'.*?\'\'\'|\/.*?\/)/', // Includes regex literals |
| | + 'string' => '/(\'.*?\'|\'\'\'.*?\'\'\'|\/.*?\/)/', |
| | 'keyword' => '/\b(def|task|apply|plugin|sourceCompatibility|targetCompatibility|repositories|dependencies|test|group|version|plugins|buildscript|allprojects|subprojects|project|ext|implementation|api|compileOnly|runtimeOnly|testImplementation|testRuntimeOnly|mavenCentral|google|jcenter|classpath)\b/', |
| | - 'function' => '/\b([a-zA-Z_][a-zA-Z0-9_]*)\s*(?=\{)/', // Gradle tasks often look like taskname { |
| | + 'function' => '/\b([a-zA-Z_][a-zA-Z0-9_]*)\s*(?=\{)/', |
| | 'variable' => '/(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{[^}]+\})/', |
| | 'boolean' => '/\b(true|false|null)\b/', |
 |
| | 'css' => [ |
| | 'comment' => '/(\/\*.*?\*\/)/s', |
| | - 'tag' => '/(?<=^|\}|\{)\s*([a-zA-Z0-9_\-#\.\s,>+~]+)(?=\{)/m', /* Selectors */ |
| | - 'property' => '/([a-zA-Z-]+)(?=\s*:)/', /* Properties */ |
| | + 'tag' => '/(?<=^|\}|\{)\s*([a-zA-Z0-9_\-#\.\s,>+~]+)(?=\{)/m', |
| | + 'property' => '/([a-zA-Z-]+)(?=\s*:)/', |
| | 'string' => '/' . $str . '/', |
| | 'number' => '/(-?(\d*\.)?\d+(px|em|rem|%|vh|vw|s|ms|deg))/', |
| | ], |
| | 'json' => [ |
| | - 'attribute' => '/(".*?")(?=\s*:)/', /* Keys are attributes (orange) in Monokai */ |
| | - 'string' => '/(".*?")/', /* Values */ |
| | + 'attribute' => '/(".*?")(?=\s*:)/', |
| | + 'string' => '/(".*?")/', |
| | 'boolean' => '/\b(true|false|null)\b/', |
| | 'number' => '/\b(-?\d+(\.\d+)?([eE][+-]?\d+)?)\b/', |
 |
| | ], |
| | 'markdown' => [ |
| | - 'comment' => '/(```[\s\S]*?```|~~~[\s\S]*?~~~)/', // Fenced code blocks |
| | - 'keyword' => '/^(#{1,6})(?=\s)/m', // Heading markers only (# ## ###) |
| | - 'string' => '/(\*\*[^\n*]+\*\*|__[^\n_]+__)/', // Bold text |
| | - 'attribute' => '/(?<!\*)(\*[^\n*]+\*)(?!\*)|(?<!_)(_[^\n_]+_)(?!_)/', // Italic text (single * or _) |
| | - 'function' => '/(`[^`\n]+`)/', // Inline code |
| | - 'variable' => '/(\[[^\]]+\]\([^\)]+\))/', // Links [text](url) |
| | - 'operator' => '/^(\s*[-*+](?=\s)|\s*\d+\.(?=\s))/m', // List markers |
| | + 'comment' => '/(```[\s\S]*?```|~~~[\s\S]*?~~~)/', |
| | + 'keyword' => '/^(#{1,6})(?=\s)/m', |
| | + 'string' => '/(\*\*[^\n*]+\*\*|__[^\n_]+__)/', |
| | + 'attribute' => '/(?<!\*)(\*[^\n*]+\*)(?!\*)|(?<!_)(_[^\n_]+_)(?!_)/', |
| | + 'function' => '/(`[^`\n]+`)/', |
| | + 'variable' => '/(\[[^\]]+\]\([^\)]+\))/', |
| | + 'operator' => '/^(\s*[-*+](?=\s)|\s*\d+\.(?=\s))/m', |
| | ], |
| | 'rmd' => [ |
| | - 'comment' => '/(```\{r[^\}]*\}[\s\S]*?```)/', // R code blocks with {r} |
| | - 'keyword' => '/^(#{1,6})(?=\s)/m', // Heading markers only |
| | - 'string' => '/(\*\*[^\n*]+\*\*|__[^\n_]+__)/', // Bold text |
| | - 'attribute' => '/(?<!\*)(\*[^\n*]+\*)(?!\*)|(?<!_)(_[^\n_]+_)(?!_)/', // Italic text |
| | - 'function' => '/(`[^`\n]+`)/', // Inline code |
| | - 'variable' => '/(\[[^\]]+\]\([^\)]+\))/', // Links [text](url) |
| | - 'operator' => '/^(\s*[-*+](?=\s)|\s*\d+\.(?=\s))/m', // List markers |
| | + 'comment' => '/(```\{r[^\}]*\}[\s\S]*?```)/', |
| | + 'keyword' => '/^(#{1,6})(?=\s)/m', |
| | + 'string' => '/(\*\*[^\n*]+\*\*|__[^\n_]+__)/', |
| | + 'attribute' => '/(?<!\*)(\*[^\n*]+\*)(?!\*)|(?<!_)(_[^\n_]+_)(?!_)/', |
| | + 'function' => '/(`[^`\n]+`)/', |
| | + 'variable' => '/(\[[^\]]+\]\([^\)]+\))/', |
| | + 'operator' => '/^(\s*[-*+](?=\s)|\s*\d+\.(?=\s))/m', |
| | ], |
| | 'r' => [ |