flinker-markdown 1.1.3 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/md.js +9 -7
- package/dist/types/md.d.ts +2 -1
- package/package.json +1 -1
package/dist/esm/md.js
CHANGED
|
@@ -59,16 +59,14 @@ export class MDGrammar {
|
|
|
59
59
|
this.code = new MDInlineGrammarRule();
|
|
60
60
|
this.code.matcher = [/``([^`]+)``/g, '<code>$1</code>'];
|
|
61
61
|
this.figure = new MDInlineGrammarRule();
|
|
62
|
-
this.figure.matcher = [/\[img:([
|
|
62
|
+
this.figure.matcher = [/\[img:([^, ]+), ?([^\]]+)\]/gm, '<figure><img src="$1"/><figcaption>$2</figcaption></figure>'];
|
|
63
63
|
this.img = new MDInlineGrammarRule();
|
|
64
|
-
this.img.matcher = [/\[img:([
|
|
64
|
+
this.img.matcher = [/\[img:([^\]]+)\]/gm, '<img src="$1"/>'];
|
|
65
65
|
this.link = new MDInlineGrammarRule();
|
|
66
|
-
this.link.matcher = [/\[link:([
|
|
66
|
+
this.link.matcher = [/\[link:([^, ]+),? ?([^\]]*)\]/, (line, url, descr) => {
|
|
67
67
|
return '<a href="' + url + '">' + (descr || url) + '</a>';
|
|
68
68
|
}];
|
|
69
|
-
this.
|
|
70
|
-
this.audio.matcher = [/\[audio:([^\]]+)\]/, '<audio controls src="$1"></audio>'];
|
|
71
|
-
this.globalRule.childrenInlineRules = [this.code, this.figure, this.img, this.link, this.audio, this.sub, this.sup, this.strong, this.boldItalic, this.bold, this.em, this.italic];
|
|
69
|
+
this.globalRule.childrenInlineRules = [this.code, this.figure, this.img, this.link, this.sub, this.sup, this.strong, this.boldItalic, this.bold, this.em, this.italic];
|
|
72
70
|
//
|
|
73
71
|
// LINE GRAMMAR RULES
|
|
74
72
|
//
|
|
@@ -107,7 +105,11 @@ export class MDGrammar {
|
|
|
107
105
|
this.uli.matcher = [/^\+ (.*)$/, '<li>$1</li>'];
|
|
108
106
|
this.uli.childrenInlineRules = this.globalRule.childrenInlineRules;
|
|
109
107
|
this.uli.preProccessing = defLinePreproccessing;
|
|
110
|
-
this.
|
|
108
|
+
this.audio = new MDLineGrammarRule();
|
|
109
|
+
this.audio.matcher = [/\[audio:([^\]]+)\]/, '<audio controls src="$1"></audio>'];
|
|
110
|
+
this.video = new MDLineGrammarRule();
|
|
111
|
+
this.video.matcher = [/\[video:([^\]]+)\]/, '<video controls src="$1"></audio>'];
|
|
112
|
+
this.globalRule.childrenLineRules = [this.header, this.quote, this.alignCenter, this.alignRight, this.audio, this.video, this.stars, this.br, this.p];
|
|
111
113
|
//
|
|
112
114
|
// MULTILINE GRAMMAR RULES
|
|
113
115
|
//
|
package/dist/types/md.d.ts
CHANGED
|
@@ -35,7 +35,6 @@ export declare class MDGrammar {
|
|
|
35
35
|
readonly figure: MDInlineGrammarRule;
|
|
36
36
|
readonly img: MDInlineGrammarRule;
|
|
37
37
|
readonly link: MDInlineGrammarRule;
|
|
38
|
-
readonly audio: MDInlineGrammarRule;
|
|
39
38
|
readonly header: MDLineGrammarRule;
|
|
40
39
|
readonly quote: MDLineGrammarRule;
|
|
41
40
|
readonly alignRight: MDLineGrammarRule;
|
|
@@ -45,6 +44,8 @@ export declare class MDGrammar {
|
|
|
45
44
|
readonly br: MDLineGrammarRule;
|
|
46
45
|
readonly oli: MDLineGrammarRule;
|
|
47
46
|
readonly uli: MDLineGrammarRule;
|
|
47
|
+
readonly audio: MDLineGrammarRule;
|
|
48
|
+
readonly video: MDLineGrammarRule;
|
|
48
49
|
readonly ol: MDMultilineGrammarRule;
|
|
49
50
|
readonly ul: MDMultilineGrammarRule;
|
|
50
51
|
readonly table: MDMultilineGrammarRule;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flinker-markdown",
|
|
3
3
|
"description": "Free TypeScript library for parsing markdown text (customisable, not standardized).",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.5",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/Dittner/FlinkerMD.git"
|