• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythongamewindowsbathyscaphephpguic翻訳omegattwitterframeworktestbtronarduinovb.net計画中(planning stage)directxpreviewerゲームエンジンdom

generic text markup tools


Commit MetaInfo

修订版e71c5437fee0c1932c6edae26bc1b8c5baee8034 (tree)
时间2017-12-21 03:22:53
作者hylom <hylom@hylo...>
Commiterhylom

Log Message

jarkup.json: add math related modes

更改概述

差异

--- a/jarkup.json
+++ b/jarkup.json
@@ -92,11 +92,31 @@
9292 "langCode",
9393 "table",
9494 "unOrderdList",
95+ "orderdList",
9596 "note",
9697 "comment",
97- "codeList"
98+ "codeList",
99+ "mathBlock"
98100 ]
99101 },
102+ "orderdList": {
103+ "rules": {
104+ "listItem": {
105+ "priority": 100,
106+ "regexp": "^[0-9]+\\.\\s+(.*)$",
107+ "replace": "<li>\\1</li>",
108+ "apply": "inline"
109+ }
110+ },
111+ "begin": "^[0-9]+\\.\\s+",
112+ "end": "^\\s*$",
113+ "onStart": {
114+ "insert": "<ol>\n"
115+ },
116+ "onFinished": {
117+ "insert": "</ol>\n"
118+ }
119+ },
100120 "unOrderdList": {
101121 "rules": {
102122 "listItem": {
@@ -253,8 +273,10 @@
253273 "langCode",
254274 "table",
255275 "unOrderdList",
276+ "orderdList",
256277 "comment",
257- "codeList"
278+ "codeList",
279+ "mathBlock"
258280 ],
259281 "begin": "^☆note\\s*(.*)$",
260282 "end": "^☆note-end\\s*$",
@@ -278,6 +300,30 @@
278300 }
279301 }
280302 },
303+ "mathBlock": {
304+ "rules": {
305+ "mathSub1": {
306+ "priority": 112,
307+ "regexp": "_([ -~])",
308+ "replace": "<sub>\\1</sub>"
309+ },
310+ "mathSub2": {
311+ "priority": 113,
312+ "regexp": "_\\{([ -~]+)}",
313+ "replace": "<sub>\\1</sub>"
314+ }
315+ },
316+ "begin": "^☆=---\\s*$",
317+ "end": "^☆=---\\s*$",
318+ "onStart": {
319+ "insert": "<pre style='font-family: serif; font-style: italic;'>",
320+ "replace": ""
321+ },
322+ "onFinished": {
323+ "insert": "</pre>",
324+ "replace": ""
325+ }
326+ },
281327 "inline": {
282328 "includeRule": ["fontDecoration", "toEntity"],
283329 "rules": {
@@ -295,6 +341,26 @@
295341 "priority": 102,
296342 "regexp": "\\*(図|表|リスト|実行例)([0-9A-Za-z、]+)",
297343 "replace": "<strong>\\1\\2</strong>"
344+ },
345+ "math": {
346+ "priority": 120,
347+ "regexp": "=\\{([ -~]*)}",
348+ "replace": "<span style='font-family: serif;'><i>\\1</i></span>"
349+ },
350+ "boldmath": {
351+ "priority": 121,
352+ "regexp": "=b\\{([ -~]*)}",
353+ "replace": "<span style='font-family: serif;'><strong><i>\\1</i></strong></span>"
354+ },
355+ "mathSub1": {
356+ "priority": 110,
357+ "regexp": "<i>(.*?)_([ -~])(.*?)</i>",
358+ "replace": "<i>\\1<sub>\\2</sub>\\3</i>"
359+ },
360+ "mathSub2": {
361+ "priority": 111,
362+ "regexp": "<i>(.*?)_\\{([ -~]+?)}(.*?)</i>",
363+ "replace": "<i>\\1<sub>\\2</sub>\\3</i>"
298364 }
299365 }
300366 }