Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9343250
org.b0aa3dbbf3faa5cf8a6d.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
26 KB
Subscribers
None
org.b0aa3dbbf3faa5cf8a6d.js
View Options
(
self
.
webpackChunkswh_name_
=
self
.
webpackChunkswh_name_
||
[]).
push
([[
46
],{
47213
:
function
(
e
,
t
,
n
){
"use strict"
;
n
.
r
(
t
);
var
i
=
n
(
24584
),
r
=
{};
for
(
var
s
in
i
)
"default"
!==
s
&&
(
r
[
s
]
=
function
(
e
){
return
i
[
e
]}.
bind
(
0
,
s
));
n
.
d
(
t
,
r
)},
24584
:
function
(
e
,
t
,
n
){{
function
i
(
e
){
for
(
var
n
in
e
)
e
.
hasOwnProperty
(
n
)
&&
(
t
[
n
]
=
e
[
n
])}
i
(
n
(
28812
)),
i
(
n
(
48084
)),
i
(
n
(
28286
)),
i
(
n
(
28812
)),
i
(
n
(
56714
)),
i
(
n
(
78888
))}},
69365
:
function
(
e
,
t
,
n
){
var
i
=
n
(
28286
).
Node
;
function
r
(){}
r
.
prototype
=
{
exportOptions
:
{
headerOffset
:
1
,
exportFromLineNumber
:!
1
,
suppressSubScriptHandling
:!
1
,
suppressAutoLink
:!
1
,
translateSymbolArrow
:!
1
,
suppressCheckboxHandling
:!
1
,
customDirectiveHandler
:
null
,
htmlClassPrefix
:
null
,
htmlIdPrefix
:
null
},
untitled
:
"Untitled"
,
result
:
null
,
initialize
:
function
(
e
,
t
){
this
.
orgDocument
=
e
,
this
.
documentOptions
=
e
.
options
||
{},
this
.
exportOptions
=
t
||
{},
this
.
headers
=
[],
this
.
headerOffset
=
"number"
==
typeof
this
.
exportOptions
.
headerOffset
?
this
.
exportOptions
.
headerOffset
:
1
,
this
.
sectionNumbers
=
[
0
]},
createTocItem
:
function
(
e
,
t
){
var
n
=
[];
return
n
.
parent
=
t
,{
headerNode
:
e
,
childTocs
:
n
}},
computeToc
:
function
(
e
){
"number"
!=
typeof
e
&&
(
e
=
1
/
0
);
var
t
=
[];
t
.
parent
=
null
;
for
(
var
n
=
1
,
r
=
t
,
s
=
0
;
s
<
this
.
headers
.
length
;
++
s
){
var
o
=
this
.
headers
[
s
];
if
(
!
(
o
.
level
>
e
)){
var
a
=
o
.
level
-
n
;
if
(
a
>
0
)
for
(
var
l
=
0
;
l
<
a
;
++
l
){
if
(
0
===
r
.
length
){
var
c
=
i
.
createHeader
([],{
level
:
n
+
l
});
c
.
sectionNumberText
=
""
,
r
.
push
(
this
.
createTocItem
(
c
,
r
))}
r
=
r
[
r
.
length
-
1
].
childTocs
}
else
if
(
a
<
0
){
a
=-
a
;
for
(
var
h
=
0
;
h
<
a
;
++
h
)
r
=
r
.
parent
}
r
.
push
(
this
.
createTocItem
(
o
,
r
)),
n
=
o
.
level
}}
return
t
},
convertNode
:
function
(
e
,
t
,
n
){
n
||
(
e
.
type
===
i
.
types
.
directive
?
"example"
!==
e
.
directiveName
&&
"src"
!==
e
.
directiveName
||
(
n
=!
0
)
:
e
.
type
===
i
.
types
.
preformatted
&&
(
n
=!
0
)),
"string"
==
typeof
e
&&
(
e
=
i
.
createText
(
null
,{
value
:
e
}));
var
r
,
s
=
e
.
children
?
this
.
convertNodesInternal
(
e
.
children
,
t
,
n
)
:
""
,
o
=
this
.
computeAuxDataForNode
(
e
);
switch
(
e
.
type
){
case
i
.
types
.
header
:
var
a
=
null
;
0
===
s
.
indexOf
(
"TODO "
)
?
a
=
"todo"
:
0
===
s
.
indexOf
(
"DONE "
)
&&
(
a
=
"done"
);
var
l
=
null
;
if
(
t
){
var
c
=
e
.
level
,
h
=
this
.
sectionNumbers
.
length
;
if
(
c
>
h
)
for
(
var
u
=
c
-
h
,
p
=
0
;
p
<
u
;
++
p
)
this
.
sectionNumbers
[
c
-
1
-
p
]
=
0
;
else
c
<
h
&&
(
this
.
sectionNumbers
.
length
=
c
);
this
.
sectionNumbers
[
c
-
1
]
++
,
l
=
this
.
sectionNumbers
.
join
(
"."
),
e
.
sectionNumberText
=
l
}
r
=
this
.
convertHeader
(
e
,
s
,
o
,
a
,
l
),
t
&&
this
.
headers
.
push
(
e
);
break
;
case
i
.
types
.
orderedList
:
r
=
this
.
convertOrderedList
(
e
,
s
,
o
);
break
;
case
i
.
types
.
unorderedList
:
r
=
this
.
convertUnorderedList
(
e
,
s
,
o
);
break
;
case
i
.
types
.
definitionList
:
r
=
this
.
convertDefinitionList
(
e
,
s
,
o
);
break
;
case
i
.
types
.
listElement
:
if
(
e
.
isDefinitionList
){
var
d
=
this
.
convertNodesInternal
(
e
.
term
,
t
,
n
);
r
=
this
.
convertDefinitionItem
(
e
,
s
,
o
,
d
,
s
)}
else
r
=
this
.
convertListItem
(
e
,
s
,
o
);
break
;
case
i
.
types
.
paragraph
:
r
=
this
.
convertParagraph
(
e
,
s
,
o
);
break
;
case
i
.
types
.
preformatted
:
r
=
this
.
convertPreformatted
(
e
,
s
,
o
);
break
;
case
i
.
types
.
table
:
r
=
this
.
convertTable
(
e
,
s
,
o
);
break
;
case
i
.
types
.
tableRow
:
r
=
this
.
convertTableRow
(
e
,
s
,
o
);
break
;
case
i
.
types
.
tableCell
:
r
=
e
.
isHeader
?
this
.
convertTableHeader
(
e
,
s
,
o
)
:
this
.
convertTableCell
(
e
,
s
,
o
);
break
;
case
i
.
types
.
horizontalRule
:
r
=
this
.
convertHorizontalRule
(
e
,
s
,
o
);
break
;
case
i
.
types
.
inlineContainer
:
r
=
this
.
convertInlineContainer
(
e
,
s
,
o
);
break
;
case
i
.
types
.
bold
:
r
=
this
.
convertBold
(
e
,
s
,
o
);
break
;
case
i
.
types
.
italic
:
r
=
this
.
convertItalic
(
e
,
s
,
o
);
break
;
case
i
.
types
.
underline
:
r
=
this
.
convertUnderline
(
e
,
s
,
o
);
break
;
case
i
.
types
.
code
:
r
=
this
.
convertCode
(
e
,
s
,
o
);
break
;
case
i
.
types
.
dashed
:
r
=
this
.
convertDashed
(
e
,
s
,
o
);
break
;
case
i
.
types
.
link
:
r
=
this
.
convertLink
(
e
,
s
,
o
);
break
;
case
i
.
types
.
directive
:
switch
(
e
.
directiveName
){
case
"quote"
:
r
=
this
.
convertQuote
(
e
,
s
,
o
);
break
;
case
"example"
:
r
=
this
.
convertExample
(
e
,
s
,
o
);
break
;
case
"src"
:
r
=
this
.
convertSrc
(
e
,
s
,
o
);
break
;
case
"html"
:
case
"html:"
:
r
=
this
.
convertHTML
(
e
,
s
,
o
);
break
;
default
:
r
=
this
.
exportOptions
.
customDirectiveHandler
&&
this
.
exportOptions
.
customDirectiveHandler
[
e
.
directiveName
]
?
this
.
exportOptions
.
customDirectiveHandler
[
e
.
directiveName
](
e
,
s
,
o
)
:
s
}
break
;
case
i
.
types
.
text
:
r
=
this
.
convertText
(
e
.
value
,
n
);
break
;
default
:
throw
Error
(
"Unknown node type: "
+
e
.
type
)}
return
"function"
==
typeof
this
.
postProcess
&&
(
r
=
this
.
postProcess
(
e
,
r
,
n
)),
r
},
convertText
:
function
(
e
,
t
){
var
n
=
this
.
escapeSpecialChars
(
e
,
t
);
return
this
.
exportOptions
.
suppressSubScriptHandling
||
t
||
(
n
=
this
.
makeSubscripts
(
n
,
t
)),
this
.
exportOptions
.
suppressAutoLink
||
(
n
=
this
.
linkURL
(
n
)),
n
},
convertHTML
:
function
(
e
,
t
,
n
){
return
t
},
convertNodesInternal
:
function
(
e
,
t
,
n
){
for
(
var
i
=
[],
r
=
0
;
r
<
e
.
length
;
++
r
){
var
s
=
e
[
r
],
o
=
this
.
convertNode
(
s
,
t
,
n
);
i
.
push
(
o
)}
return
this
.
combineNodesTexts
(
i
)},
convertHeaderBlock
:
function
(
e
,
t
){
throw
Error
(
"convertHeaderBlock is not implemented"
)},
convertHeaderTree
:
function
(
e
,
t
){
return
this
.
convertHeaderBlock
(
e
,
t
)},
convertNodesToHeaderTree
:
function
(
e
,
t
,
n
){
var
r
=
[],
s
=
[];
void
0
===
t
&&
(
t
=
0
),
void
0
===
n
&&
(
n
=
null
);
for
(
var
o
=
t
;
o
<
e
.
length
;){
var
a
=
e
[
o
];
if
(
a
.
type
===
i
.
types
.
header
){
if
(
n
&&
a
.
level
<=
n
.
level
)
break
;
var
l
=
this
.
convertNodesToHeaderTree
(
e
,
o
+
1
,
a
);
r
.
push
(
l
),
o
=
l
.
nextIndex
}
else
s
.
push
(
a
),
o
+=
1
}
return
{
header
:
n
,
childNodes
:
s
,
nextIndex
:
o
,
childBlocks
:
r
}},
convertNodes
:
function
(
e
,
t
,
n
){
return
this
.
convertNodesInternal
(
e
,
t
,
n
)},
combineNodesTexts
:
function
(
e
){
return
e
.
join
(
""
)},
getNodeTextContent
:
function
(
e
){
return
e
.
type
===
i
.
types
.
text
?
this
.
escapeSpecialChars
(
e
.
value
)
:
e
.
children
?
e
.
children
.
map
(
this
.
getNodeTextContent
,
this
).
join
(
""
)
:
""
},
escapeSpecialChars
:
function
(
e
){
throw
Error
(
"Implement escapeSpecialChars"
)},
urlPattern
:
/\b(?:https?:\/\/|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’])/gi
,
linkURL
:
function
(
e
){
var
t
=
this
;
return
e
.
replace
(
this
.
urlPattern
,(
function
(
e
){
return
e
.
indexOf
(
"://"
)
<
0
&&
(
e
=
"http://"
+
e
),
t
.
makeLink
(
e
)}))},
makeLink
:
function
(
e
){
throw
Error
(
"Implement makeLink"
)},
makeSubscripts
:
function
(
e
){
return
"{}"
===
this
.
documentOptions
[
"^"
]
?
e
.
replace
(
/\b([^_ \t]*)_{([^}]*)}/g
,
this
.
makeSubscript
)
:
this
.
documentOptions
[
"^"
]
?
e
.
replace
(
/\b([^_ \t]*)_([^_]*)\b/g
,
this
.
makeSubscript
)
:
e
},
makeSubscript
:
function
(
e
,
t
,
n
){
throw
Error
(
"Implement makeSubscript"
)},
stripParametersFromURL
:
function
(
e
){
return
e
.
replace
(
/\?.*$/
,
""
)},
imageExtensionPattern
:
new
RegExp
(
"("
+
[
"bmp"
,
"png"
,
"jpeg"
,
"jpg"
,
"gif"
,
"tiff"
,
"tif"
,
"xbm"
,
"xpm"
,
"pbm"
,
"pgm"
,
"ppm"
,
"svg"
].
join
(
"|"
)
+
")$"
,
"i"
)},
t
.
d
=
r
},
78888
:
function
(
e
,
t
,
n
){
var
i
=
n
(
69365
).
d
,
r
=
n
(
28286
).
Node
;
function
s
(
e
,
t
){
this
.
initialize
(
e
,
t
),
this
.
result
=
this
.
convert
()}
s
.
prototype
=
{
__proto__
:
i
.
prototype
,
convert
:
function
(){
var
e
=
this
.
orgDocument
.
title
?
this
.
convertNode
(
this
.
orgDocument
.
title
)
:
this
.
untitled
,
t
=
this
.
tag
(
"h"
+
Math
.
max
(
Number
(
this
.
headerOffset
),
1
),
e
),
n
=
this
.
convertNodes
(
this
.
orgDocument
.
nodes
,
!
0
),
i
=
this
.
computeToc
(
this
.
documentOptions
.
toc
),
r
=
this
.
tocToHTML
(
i
);
return
{
title
:
e
,
titleHTML
:
t
,
contentHTML
:
n
,
tocHTML
:
r
,
toc
:
i
,
toString
:
function
(){
return
t
+
r
+
"\n"
+
n
}}},
tocToHTML
:
function
(
e
){
return
function
e
(
t
){
for
(
var
n
=
""
,
i
=
0
;
i
<
t
.
length
;
++
i
){
var
r
=
t
[
i
],
s
=
r
.
headerNode
.
sectionNumberText
,
o
=
this
.
documentOptions
.
num
?
this
.
inlineTag
(
"span"
,
s
,{
class
:
"section-number"
})
:
""
,
a
=
this
.
getNodeTextContent
(
r
.
headerNode
),
l
=
this
.
inlineTag
(
"a"
,
o
+
a
,{
href
:
"#header-"
+
s
.
replace
(
/\./g
,
"-"
)}),
c
=
r
.
childTocs
.
length
?
e
.
call
(
this
,
r
.
childTocs
)
:
""
;
n
+=
this
.
tag
(
"li"
,
l
+
c
)}
return
this
.
tag
(
"ul"
,
n
)}.
call
(
this
,
e
)},
computeAuxDataForNode
:
function
(
e
){
for
(;
e
.
parent
&&
e
.
parent
.
type
===
r
.
types
.
inlineContainer
;)
e
=
e
.
parent
;
for
(
var
t
=
e
.
previousSibling
,
n
=
""
;
t
&&
t
.
type
===
r
.
types
.
directive
&&
"attr_html:"
===
t
.
directiveName
;)
n
+=
t
.
directiveRawValue
+
" "
,
t
=
t
.
previousSibling
;
return
n
},
orgClassName
:
function
(
e
){
return
this
.
exportOptions
.
htmlClassPrefix
?
this
.
exportOptions
.
htmlClassPrefix
+
e
:
e
},
orgId
:
function
(
e
){
return
this
.
exportOptions
.
htmlIdPrefix
?
this
.
exportOptions
.
htmlIdPrefix
+
e
:
e
},
convertHeader
:
function
(
e
,
t
,
n
,
i
,
r
){
var
s
=
{};
return
i
&&
(
t
=
this
.
inlineTag
(
"span"
,
t
.
substring
(
0
,
4
),{
class
:
"task-status "
+
i
})
+
t
.
substring
(
5
)),
r
&&
(
t
=
this
.
inlineTag
(
"span"
,
r
,{
class
:
"section-number"
})
+
t
,
s
.
id
=
"header-"
+
r
.
replace
(
/\./g
,
"-"
)),
i
&&
(
s
.
class
=
"task-status "
+
i
),
this
.
tag
(
"h"
+
(
this
.
headerOffset
+
e
.
level
),
t
,
s
,
n
)},
convertOrderedList
:
function
(
e
,
t
,
n
){
return
this
.
tag
(
"ol"
,
t
,
null
,
n
)},
convertUnorderedList
:
function
(
e
,
t
,
n
){
return
this
.
tag
(
"ul"
,
t
,
null
,
n
)},
convertDefinitionList
:
function
(
e
,
t
,
n
){
return
this
.
tag
(
"dl"
,
t
,
null
,
n
)},
convertDefinitionItem
:
function
(
e
,
t
,
n
,
i
,
r
){
return
this
.
tag
(
"dt"
,
i
)
+
this
.
tag
(
"dd"
,
r
)},
convertListItem
:
function
(
e
,
t
,
n
){
if
(
this
.
exportOptions
.
suppressCheckboxHandling
)
return
this
.
tag
(
"li"
,
t
,
null
,
n
);
var
i
=
{},
r
=
t
;
if
(
/^\s*\[(X| |-)\]([\s\S]*)/
.
exec
(
r
)){
r
=
RegExp
.
$2
;
var
s
=
{
type
:
"checkbox"
};
switch
(
RegExp
.
$1
){
case
"X"
:
s
.
checked
=
"true"
,
i
[
"data-checkbox-status"
]
=
"done"
;
break
;
case
"-"
:
i
[
"data-checkbox-status"
]
=
"intermediate"
;
break
;
default
:
i
[
"data-checkbox-status"
]
=
"undone"
}
r
=
this
.
inlineTag
(
"input"
,
null
,
s
)
+
r
}
return
this
.
tag
(
"li"
,
r
,
i
,
n
)},
convertParagraph
:
function
(
e
,
t
,
n
){
return
this
.
tag
(
"p"
,
t
,
null
,
n
)},
convertPreformatted
:
function
(
e
,
t
,
n
){
return
this
.
tag
(
"pre"
,
t
,
null
,
n
)},
convertTable
:
function
(
e
,
t
,
n
){
return
this
.
tag
(
"table"
,
this
.
tag
(
"tbody"
,
t
),
null
,
n
)},
convertTableRow
:
function
(
e
,
t
,
n
){
return
this
.
tag
(
"tr"
,
t
)},
convertTableHeader
:
function
(
e
,
t
,
n
){
return
this
.
tag
(
"th"
,
t
)},
convertTableCell
:
function
(
e
,
t
,
n
){
return
this
.
tag
(
"td"
,
t
)},
convertHorizontalRule
:
function
(
e
,
t
,
n
){
return
this
.
tag
(
"hr"
,
null
,
null
,
n
)},
convertInlineContainer
:
function
(
e
,
t
,
n
){
return
t
},
convertBold
:
function
(
e
,
t
,
n
){
return
this
.
inlineTag
(
"b"
,
t
)},
convertItalic
:
function
(
e
,
t
,
n
){
return
this
.
inlineTag
(
"i"
,
t
)},
convertUnderline
:
function
(
e
,
t
,
n
){
return
this
.
inlineTag
(
"span"
,
t
,{
style
:
"text-decoration:underline;"
})},
convertCode
:
function
(
e
,
t
,
n
){
return
this
.
inlineTag
(
"code"
,
t
)},
convertDashed
:
function
(
e
,
t
,
n
){
return
this
.
inlineTag
(
"del"
,
t
)},
convertLink
:
function
(
e
,
t
,
n
){
var
i
=
this
.
stripParametersFromURL
(
e
.
src
);
if
(
this
.
imageExtensionPattern
.
exec
(
i
)){
var
r
=
this
.
getNodeTextContent
(
e
);
return
this
.
inlineTag
(
"img"
,
null
,{
src
:
e
.
src
,
alt
:
r
,
title
:
r
},
n
)}
return
this
.
inlineTag
(
"a"
,
t
,{
href
:
e
.
src
})},
convertQuote
:
function
(
e
,
t
,
n
){
return
this
.
tag
(
"blockquote"
,
t
,
null
,
n
)},
convertExample
:
function
(
e
,
t
,
n
){
return
this
.
tag
(
"pre"
,
t
,
null
,
n
)},
convertSrc
:
function
(
e
,
t
,
n
){
var
i
=
e
.
directiveArguments
.
length
?
e
.
directiveArguments
[
0
]
:
"unknown"
;
return
t
=
this
.
tag
(
"code"
,
t
,{
class
:
"language-"
+
i
},
n
),
this
.
tag
(
"pre"
,
t
,{
class
:
"prettyprint"
})},
convertHTML
:
function
(
e
,
t
,
n
){
return
"html:"
===
e
.
directiveName
?
e
.
directiveRawValue
:
"html"
===
e
.
directiveName
?
e
.
children
.
map
((
function
(
e
){
return
e
.
value
})).
join
(
"\n"
)
:
t
},
convertHeaderBlock
:
function
(
e
,
t
,
n
){
t
=
t
||
0
,
n
=
n
||
0
;
var
i
=
[],
r
=
e
.
header
;
r
&&
i
.
push
(
this
.
convertNode
(
r
));
var
s
=
this
.
convertNodes
(
e
.
childNodes
);
i
.
push
(
s
);
var
o
=
e
.
childBlocks
.
map
((
function
(
e
,
n
){
return
this
.
convertHeaderBlock
(
e
,
t
+
1
,
n
)}),
this
).
join
(
"\n"
);
i
.
push
(
o
);
var
a
=
i
.
join
(
"\n"
);
return
r
?
this
.
tag
(
"section"
,
"\n"
+
i
.
join
(
"\n"
),{
class
:
"block block-level-"
+
t
})
:
a
},
replaceMap
:
{
"&"
:
[
"&"
,
null
],
"<"
:
[
"<"
,
null
],
">"
:
[
">"
,
null
],
'"'
:
[
"""
,
null
],
"'"
:
[
"'"
,
null
],
"->"
:
[
"➔"
,
function
(
e
,
t
){
return
this
.
exportOptions
.
translateSymbolArrow
&&!
t
}]},
replaceRegexp
:
null
,
escapeSpecialChars
:
function
(
e
,
t
){
this
.
replaceRegexp
||
(
this
.
replaceRegexp
=
new
RegExp
(
Object
.
keys
(
this
.
replaceMap
).
join
(
"|"
),
"g"
));
var
n
=
this
.
replaceMap
,
i
=
this
;
return
e
.
replace
(
this
.
replaceRegexp
,(
function
(
r
){
if
(
!
n
[
r
])
throw
Error
(
"escapeSpecialChars: Invalid match"
);
var
s
=
n
[
r
][
1
];
return
"function"
!=
typeof
s
||
s
.
call
(
i
,
e
,
t
)
?
n
[
r
][
0
]
:
r
}))},
postProcess
:
function
(
e
,
t
,
n
){
return
this
.
exportOptions
.
exportFromLineNumber
&&
"number"
==
typeof
e
.
fromLineNumber
&&
(
t
=
this
.
inlineTag
(
"div"
,
t
,{
"data-line-number"
:
e
.
fromLineNumber
})),
t
},
makeLink
:
function
(
e
){
return
'<a href="'
+
e
+
'">'
+
decodeURIComponent
(
e
)
+
"</a>"
},
makeSubscript
:
function
(
e
,
t
,
n
){
return
'<span class="org-subscript-parent">'
+
t
+
'</span><span class="org-subscript-child">'
+
n
+
"</span>"
},
attributesObjectToString
:
function
(
e
){
var
t
=
""
;
for
(
var
n
in
e
)
if
(
e
.
hasOwnProperty
(
n
)){
var
i
=
e
[
n
];
"class"
===
n
?
i
=
this
.
orgClassName
(
i
)
:
"id"
===
n
&&
(
i
=
this
.
orgId
(
i
)),
t
+=
" "
+
n
+
'="'
+
i
+
'"'
}
return
t
},
inlineTag
:
function
(
e
,
t
,
n
,
i
){
n
=
n
||
{};
var
r
=
"<"
+
e
;
return
i
&&
(
r
+=
" "
+
i
),
r
+=
this
.
attributesObjectToString
(
n
),
null
===
t
?
r
+
"/>"
:
r
+=
">"
+
t
+
"</"
+
e
+
">"
},
tag
:
function
(
e
,
t
,
n
,
i
){
return
this
.
inlineTag
(
e
,
t
,
n
,
i
)
+
"\n"
}},
t
.
ConverterHTML
=
s
},
48084
:
function
(
e
,
t
){
var
n
=
{
rules
:
{},
define
:
function
(
e
,
t
){
this
.
rules
[
e
]
=
t
,
this
[
"is"
+
e
.
substring
(
0
,
1
).
toUpperCase
()
+
e
.
substring
(
1
)]
=
function
(
t
){
return
this
.
rules
[
e
].
exec
(
t
)}}};
function
i
(){}
function
r
(
e
){
this
.
stream
=
e
,
this
.
tokenStack
=
[]}
n
.
define
(
"header"
,
/^(\*+)\s+(.*)$/
),
n
.
define
(
"preformatted"
,
/^(\s*):(?: (.*)$|$)/
),
n
.
define
(
"unorderedListElement"
,
/^(\s*)(?:-|\+|\s+\*)\s+(.*)$/
),
n
.
define
(
"orderedListElement"
,
/^(\s*)(\d+)(?:\.|\))\s+(.*)$/
),
n
.
define
(
"tableSeparator"
,
/^(\s*)\|((?:\+|-)*?)\|?$/
),
n
.
define
(
"tableRow"
,
/^(\s*)\|(.*?)\|?$/
),
n
.
define
(
"blank"
,
/^$/
),
n
.
define
(
"horizontalRule"
,
/^(\s*)-{5,}$/
),
n
.
define
(
"directive"
,
/^(\s*)#\+(?:(begin|end)_)?(.*)$/i
),
n
.
define
(
"comment"
,
/^(\s*)#(.*)$/
),
n
.
define
(
"line"
,
/^(\s*)(.*)$/
),
i
.
prototype
=
{
isListElement
:
function
(){
return
this
.
type
===
r
.
tokens
.
orderedListElement
||
this
.
type
===
r
.
tokens
.
unorderedListElement
},
isTableElement
:
function
(){
return
this
.
type
===
r
.
tokens
.
tableSeparator
||
this
.
type
===
r
.
tokens
.
tableRow
}},
r
.
prototype
=
{
tokenize
:
function
(
e
){
var
t
=
new
i
;
if
(
t
.
fromLineNumber
=
this
.
stream
.
lineNumber
,
n
.
isHeader
(
e
))
t
.
type
=
r
.
tokens
.
header
,
t
.
indentation
=
0
,
t
.
content
=
RegExp
.
$2
,
t
.
level
=
RegExp
.
$1
.
length
;
else
if
(
n
.
isPreformatted
(
e
))
t
.
type
=
r
.
tokens
.
preformatted
,
t
.
indentation
=
RegExp
.
$1
.
length
,
t
.
content
=
RegExp
.
$2
;
else
if
(
n
.
isUnorderedListElement
(
e
))
t
.
type
=
r
.
tokens
.
unorderedListElement
,
t
.
indentation
=
RegExp
.
$1
.
length
,
t
.
content
=
RegExp
.
$2
;
else
if
(
n
.
isOrderedListElement
(
e
))
t
.
type
=
r
.
tokens
.
orderedListElement
,
t
.
indentation
=
RegExp
.
$1
.
length
,
t
.
content
=
RegExp
.
$3
,
t
.
number
=
RegExp
.
$2
;
else
if
(
n
.
isTableSeparator
(
e
))
t
.
type
=
r
.
tokens
.
tableSeparator
,
t
.
indentation
=
RegExp
.
$1
.
length
,
t
.
content
=
RegExp
.
$2
;
else
if
(
n
.
isTableRow
(
e
))
t
.
type
=
r
.
tokens
.
tableRow
,
t
.
indentation
=
RegExp
.
$1
.
length
,
t
.
content
=
RegExp
.
$2
;
else
if
(
n
.
isBlank
(
e
))
t
.
type
=
r
.
tokens
.
blank
,
t
.
indentation
=
0
,
t
.
content
=
null
;
else
if
(
n
.
isHorizontalRule
(
e
))
t
.
type
=
r
.
tokens
.
horizontalRule
,
t
.
indentation
=
RegExp
.
$1
.
length
,
t
.
content
=
null
;
else
if
(
n
.
isDirective
(
e
)){
t
.
type
=
r
.
tokens
.
directive
,
t
.
indentation
=
RegExp
.
$1
.
length
,
t
.
content
=
RegExp
.
$3
;
var
s
=
RegExp
.
$2
;
/^begin/i
.
test
(
s
)
?
t
.
beginDirective
=!
0
:
/^end/i
.
test
(
s
)
?
t
.
endDirective
=!
0
:
t
.
oneshotDirective
=!
0
}
else
if
(
n
.
isComment
(
e
))
t
.
type
=
r
.
tokens
.
comment
,
t
.
indentation
=
RegExp
.
$1
.
length
,
t
.
content
=
RegExp
.
$2
;
else
{
if
(
!
n
.
isLine
(
e
))
throw
new
Error
(
"SyntaxError: Unknown line: "
+
e
);
t
.
type
=
r
.
tokens
.
line
,
t
.
indentation
=
RegExp
.
$1
.
length
,
t
.
content
=
RegExp
.
$2
}
return
t
},
pushToken
:
function
(
e
){
this
.
tokenStack
.
push
(
e
)},
pushDummyTokenByType
:
function
(
e
){
var
t
=
new
i
;
t
.
type
=
e
,
this
.
tokenStack
.
push
(
t
)},
peekStackedToken
:
function
(){
return
this
.
tokenStack
.
length
>
0
?
this
.
tokenStack
[
this
.
tokenStack
.
length
-
1
]
:
null
},
getStackedToken
:
function
(){
return
this
.
tokenStack
.
length
>
0
?
this
.
tokenStack
.
pop
()
:
null
},
peekNextToken
:
function
(){
return
this
.
peekStackedToken
()
||
this
.
tokenize
(
this
.
stream
.
peekNextLine
())},
getNextToken
:
function
(){
return
this
.
getStackedToken
()
||
this
.
tokenize
(
this
.
stream
.
getNextLine
())},
hasNext
:
function
(){
return
this
.
stream
.
hasNext
()},
getLineNumber
:
function
(){
return
this
.
stream
.
lineNumber
}},
r
.
tokens
=
{},[
"header"
,
"orderedListElement"
,
"unorderedListElement"
,
"tableRow"
,
"tableSeparator"
,
"preformatted"
,
"line"
,
"horizontalRule"
,
"blank"
,
"directive"
,
"comment"
].
forEach
((
function
(
e
,
t
){
r
.
tokens
[
e
]
=
t
})),
t
.
Lexer
=
r
},
28286
:
function
(
e
,
t
){
function
n
(
e
,
t
){
if
(
this
.
type
=
e
,
this
.
children
=
[],
t
)
for
(
var
n
=
0
,
i
=
t
.
length
;
n
<
i
;
++
n
)
this
.
appendChild
(
t
[
n
])}
n
.
prototype
=
{
previousSibling
:
null
,
parent
:
null
,
get
firstChild
(){
return
this
.
children
.
length
<
1
?
null
:
this
.
children
[
0
]},
get
lastChild
(){
return
this
.
children
.
length
<
1
?
null
:
this
.
children
[
this
.
children
.
length
-
1
]},
appendChild
:
function
(
e
){
var
t
=
this
.
children
.
length
<
1
?
null
:
this
.
lastChild
;
this
.
children
.
push
(
e
),
e
.
previousSibling
=
t
,
e
.
parent
=
this
},
toString
:
function
(){
var
e
=
"<"
+
this
.
type
+
">"
;
return
void
0
!==
this
.
value
?
e
+=
" "
+
this
.
value
:
this
.
children
&&
(
e
+=
"\n"
+
this
.
children
.
map
((
function
(
e
,
t
){
return
"#"
+
t
+
" "
+
e
.
toString
()})).
join
(
"\n"
).
split
(
"\n"
).
map
((
function
(
e
){
return
" "
+
e
})).
join
(
"\n"
)),
e
}};
var
i
=
{
types
:
{},
define
:
function
(
e
,
t
){
this
.
types
[
e
]
=
e
;
var
i
=
"create"
+
e
.
substring
(
0
,
1
).
toUpperCase
()
+
e
.
substring
(
1
),
r
=
"function"
==
typeof
t
;
this
[
i
]
=
function
(
i
,
s
){
var
o
=
new
n
(
e
,
i
);
return
r
&&
t
(
o
,
s
||
{}),
o
}}};
i
.
define
(
"text"
,(
function
(
e
,
t
){
e
.
value
=
t
.
value
})),
i
.
define
(
"header"
,(
function
(
e
,
t
){
e
.
level
=
t
.
level
})),
i
.
define
(
"orderedList"
),
i
.
define
(
"unorderedList"
),
i
.
define
(
"definitionList"
),
i
.
define
(
"listElement"
),
i
.
define
(
"paragraph"
),
i
.
define
(
"preformatted"
),
i
.
define
(
"table"
),
i
.
define
(
"tableRow"
),
i
.
define
(
"tableCell"
),
i
.
define
(
"horizontalRule"
),
i
.
define
(
"directive"
),
i
.
define
(
"inlineContainer"
),
i
.
define
(
"bold"
),
i
.
define
(
"italic"
),
i
.
define
(
"underline"
),
i
.
define
(
"code"
),
i
.
define
(
"verbatim"
),
i
.
define
(
"dashed"
),
i
.
define
(
"link"
,(
function
(
e
,
t
){
e
.
src
=
t
.
src
})),
t
.
Node
=
i
},
28812
:
function
(
e
,
t
,
n
){
var
i
=
n
(
56714
).
Stream
,
r
=
n
(
48084
).
Lexer
,
s
=
n
(
28286
).
Node
;
function
o
(){
this
.
inlineParser
=
new
a
}
function
a
(){
this
.
preEmphasis
=
" \t\\('\""
,
this
.
postEmphasis
=
"- \t.,:!?;'\"\\)"
,
this
.
borderForbidden
=
" \t\r\n,\"'"
,
this
.
bodyRegexp
=
"[\\s\\S]*?"
,
this
.
markers
=
"*/_=~+"
,
this
.
emphasisPattern
=
this
.
buildEmphasisPattern
(),
this
.
linkPattern
=
/\[\[([^\]]*)\](?:\[([^\]]*)\])?\]/g
}
o
.
parseStream
=
function
(
e
,
t
){
var
n
=
new
o
;
return
n
.
initStatus
(
e
,
t
),
n
.
parseNodes
(),
n
.
nodes
},
o
.
prototype
=
{
initStatus
:
function
(
e
,
t
){
if
(
"string"
==
typeof
e
&&
(
e
=
new
i
(
e
)),
this
.
lexer
=
new
r
(
e
),
this
.
nodes
=
[],
this
.
options
=
{
toc
:!
0
,
num
:!
0
,
"^"
:
"{}"
,
multilineCell
:!
1
},
t
&&
"object"
==
typeof
t
)
for
(
var
n
in
t
)
this
.
options
[
n
]
=
t
[
n
];
this
.
document
=
{
options
:
this
.
options
,
directiveValues
:
{},
convert
:
function
(
e
,
t
){
return
new
e
(
this
,
t
).
result
}}},
parse
:
function
(
e
,
t
){
return
this
.
initStatus
(
e
,
t
),
this
.
parseDocument
(),
this
.
document
.
nodes
=
this
.
nodes
,
this
.
document
},
createErrorReport
:
function
(
e
){
return
new
Error
(
e
+
" at line "
+
this
.
lexer
.
getLineNumber
())},
skipBlank
:
function
(){
for
(
var
e
=
null
;
this
.
lexer
.
peekNextToken
().
type
===
r
.
tokens
.
blank
;)
e
=
this
.
lexer
.
getNextToken
();
return
e
},
setNodeOriginFromToken
:
function
(
e
,
t
){
return
e
.
fromLineNumber
=
t
.
fromLineNumber
,
e
},
appendNode
:
function
(
e
){
var
t
=
this
.
nodes
.
length
>
0
?
this
.
nodes
[
this
.
nodes
.
length
-
1
]
:
null
;
this
.
nodes
.
push
(
e
),
e
.
previousSibling
=
t
},
parseDocument
:
function
(){
this
.
parseTitle
(),
this
.
parseNodes
()},
parseNodes
:
function
(){
for
(;
this
.
lexer
.
hasNext
();){
var
e
=
this
.
parseElement
();
e
&&
this
.
appendNode
(
e
)}},
parseTitle
:
function
(){
this
.
skipBlank
(),
this
.
lexer
.
hasNext
()
&&
this
.
lexer
.
peekNextToken
().
type
===
r
.
tokens
.
line
?
this
.
document
.
title
=
this
.
createTextNode
(
this
.
lexer
.
getNextToken
().
content
)
:
this
.
document
.
title
=
null
,
this
.
lexer
.
pushDummyTokenByType
(
r
.
tokens
.
blank
)},
parseElement
:
function
(){
var
e
=
null
;
switch
(
this
.
lexer
.
peekNextToken
().
type
){
case
r
.
tokens
.
header
:
e
=
this
.
parseHeader
();
break
;
case
r
.
tokens
.
preformatted
:
e
=
this
.
parsePreformatted
();
break
;
case
r
.
tokens
.
orderedListElement
:
case
r
.
tokens
.
unorderedListElement
:
e
=
this
.
parseList
();
break
;
case
r
.
tokens
.
line
:
e
=
this
.
parseText
();
break
;
case
r
.
tokens
.
tableRow
:
case
r
.
tokens
.
tableSeparator
:
e
=
this
.
parseTable
();
break
;
case
r
.
tokens
.
blank
:
this
.
skipBlank
(),
this
.
lexer
.
hasNext
()
&&
(
e
=
this
.
lexer
.
peekNextToken
().
type
===
r
.
tokens
.
line
?
this
.
parseParagraph
()
:
this
.
parseElement
());
break
;
case
r
.
tokens
.
horizontalRule
:
this
.
lexer
.
getNextToken
(),
e
=
s
.
createHorizontalRule
();
break
;
case
r
.
tokens
.
directive
:
e
=
this
.
parseDirective
();
break
;
case
r
.
tokens
.
comment
:
this
.
lexer
.
getNextToken
();
break
;
default
:
throw
this
.
createErrorReport
(
"Unhandled token: "
+
this
.
lexer
.
peekNextToken
().
type
)}
return
e
},
parseElementBesidesDirectiveEnd
:
function
(){
try
{
return
this
.
parseElement
=
this
.
parseElementBesidesDirectiveEndBody
,
this
.
parseElement
()}
finally
{
this
.
parseElement
=
this
.
originalParseElement
}},
parseElementBesidesDirectiveEndBody
:
function
(){
return
this
.
lexer
.
peekNextToken
().
type
===
r
.
tokens
.
directive
&&
this
.
lexer
.
peekNextToken
().
endDirective
?
null
:
this
.
originalParseElement
()},
parseHeader
:
function
(){
var
e
=
this
.
lexer
.
getNextToken
(),
t
=
s
.
createHeader
([
this
.
createTextNode
(
e
.
content
)],{
level
:
e
.
level
});
return
this
.
setNodeOriginFromToken
(
t
,
e
),
t
},
parsePreformatted
:
function
(){
var
e
=
this
.
lexer
.
peekNextToken
(),
t
=
s
.
createPreformatted
([]);
this
.
setNodeOriginFromToken
(
t
,
e
);
for
(
var
n
=
[];
this
.
lexer
.
hasNext
();){
var
i
=
this
.
lexer
.
peekNextToken
();
if
(
i
.
type
!==
r
.
tokens
.
preformatted
||
i
.
indentation
<
e
.
indentation
)
break
;
this
.
lexer
.
getNextToken
(),
n
.
push
(
i
.
content
)}
return
t
.
appendChild
(
this
.
createTextNode
(
n
.
join
(
"\n"
),
!
0
)),
t
},
definitionPattern
:
/^(.*?) :: *(.*)$/
,
parseList
:
function
(){
var
e
,
t
=
this
.
lexer
.
peekNextToken
(),
n
=!
1
;
for
(
this
.
definitionPattern
.
test
(
t
.
content
)
?
(
e
=
s
.
createDefinitionList
([]),
n
=!
0
)
:
e
=
t
.
type
===
r
.
tokens
.
unorderedListElement
?
s
.
createUnorderedList
([])
:
s
.
createOrderedList
([]),
this
.
setNodeOriginFromToken
(
e
,
t
);
this
.
lexer
.
hasNext
();){
var
i
=
this
.
lexer
.
peekNextToken
();
if
(
!
i
.
isListElement
()
||
i
.
indentation
!==
t
.
indentation
)
break
;
e
.
appendChild
(
this
.
parseListElement
(
t
.
indentation
,
n
))}
return
e
},
unknownDefinitionTerm
:
"???"
,
parseListElement
:
function
(
e
,
t
){
var
n
=
this
.
lexer
.
getNextToken
(),
i
=
s
.
createListElement
([]);
if
(
this
.
setNodeOriginFromToken
(
i
,
n
),
i
.
isDefinitionList
=
t
,
t
){
var
r
=
this
.
definitionPattern
.
exec
(
n
.
content
);
i
.
term
=
[
this
.
createTextNode
(
r
&&
r
[
1
]
?
r
[
1
]
:
this
.
unknownDefinitionTerm
)],
i
.
appendChild
(
this
.
createTextNode
(
r
?
r
[
2
]
:
n
.
content
))}
else
i
.
appendChild
(
this
.
createTextNode
(
n
.
content
));
for
(;
this
.
lexer
.
hasNext
();){
var
o
=
this
.
skipBlank
();
if
(
!
this
.
lexer
.
hasNext
())
break
;
var
a
=
this
.
lexer
.
peekNextToken
();
if
(
o
&&!
a
.
isListElement
()
&&
this
.
lexer
.
pushToken
(
o
),
a
.
indentation
<=
e
)
break
;
var
l
=
this
.
parseElement
();
l
&&
i
.
appendChild
(
l
)}
return
i
},
parseTable
:
function
(){
var
e
=
this
.
lexer
.
peekNextToken
(),
t
=
s
.
createTable
([]);
this
.
setNodeOriginFromToken
(
t
,
e
);
for
(
var
n
=!
1
,
i
=
e
.
type
===
r
.
tokens
.
tableSeparator
&&
this
.
options
.
multilineCell
;
this
.
lexer
.
hasNext
()
&&
(
e
=
this
.
lexer
.
peekNextToken
()).
isTableElement
();)
if
(
e
.
type
===
r
.
tokens
.
tableRow
){
var
o
=
this
.
parseTableRow
(
i
);
t
.
appendChild
(
o
)}
else
n
=!
0
,
this
.
lexer
.
getNextToken
();
return
n
&&
t
.
children
.
length
&&
t
.
children
[
0
].
children
.
forEach
((
function
(
e
){
e
.
isHeader
=!
0
})),
t
},
parseTableRow
:
function
(
e
){
for
(
var
t
=
[];
this
.
lexer
.
peekNextToken
().
type
===
r
.
tokens
.
tableRow
&&
(
t
.
push
(
this
.
lexer
.
getNextToken
()),
e
););
if
(
!
t
.
length
)
throw
this
.
createErrorReport
(
"Expected table row"
);
var
n
=
t
.
shift
(),
i
=
n
.
content
.
split
(
"|"
);
t
.
forEach
((
function
(
e
){
e
.
content
.
split
(
"|"
).
forEach
((
function
(
e
,
t
){
i
[
t
]
=
(
i
[
t
]
||
""
)
+
"\n"
+
e
}))}));
var
a
=
i
.
map
((
function
(
e
){
return
s
.
createTableCell
(
o
.
parseStream
(
e
))}),
this
);
return
this
.
setNodeOriginFromToken
(
s
.
createTableRow
(
a
),
n
)},
parseDirective
:
function
(){
var
e
=
this
.
lexer
.
getNextToken
(),
t
=
this
.
createDirectiveNodeFromToken
(
e
);
if
(
e
.
endDirective
)
throw
this
.
createErrorReport
(
"Unmatched 'end' directive for "
+
t
.
directiveName
);
if
(
e
.
oneshotDirective
)
return
this
.
interpretDirective
(
t
),
t
;
if
(
!
e
.
beginDirective
)
throw
this
.
createErrorReport
(
"Invalid directive "
+
t
.
directiveName
);
return
t
.
children
=
[],
this
.
isVerbatimDirective
(
t
)
?
this
.
parseDirectiveBlockVerbatim
(
t
)
:
this
.
parseDirectiveBlock
(
t
)},
createDirectiveNodeFromToken
:
function
(
e
){
var
t
=
/^[ ]*([^ ]*)[ ]*(.*)[ ]*$/
.
exec
(
e
.
content
),
n
=
s
.
createDirective
(
null
);
return
this
.
setNodeOriginFromToken
(
n
,
e
),
n
.
directiveName
=
t
[
1
].
toLowerCase
(),
n
.
directiveArguments
=
this
.
parseDirectiveArguments
(
t
[
2
]),
n
.
directiveOptions
=
this
.
parseDirectiveOptions
(
t
[
2
]),
n
.
directiveRawValue
=
t
[
2
],
n
},
isVerbatimDirective
:
function
(
e
){
var
t
=
e
.
directiveName
;
return
"src"
===
t
||
"example"
===
t
||
"html"
===
t
},
parseDirectiveBlock
:
function
(
e
,
t
){
for
(
this
.
lexer
.
pushDummyTokenByType
(
r
.
tokens
.
blank
);
this
.
lexer
.
hasNext
();){
var
n
=
this
.
lexer
.
peekNextToken
();
if
(
n
.
type
===
r
.
tokens
.
directive
&&
n
.
endDirective
&&
this
.
createDirectiveNodeFromToken
(
n
).
directiveName
===
e
.
directiveName
)
return
this
.
lexer
.
getNextToken
(),
e
;
var
i
=
this
.
parseElementBesidesDirectiveEnd
();
i
&&
e
.
appendChild
(
i
)}
throw
this
.
createErrorReport
(
"Unclosed directive "
+
e
.
directiveName
)},
parseDirectiveBlockVerbatim
:
function
(
e
){
for
(
var
t
=
[];
this
.
lexer
.
hasNext
();){
var
n
=
this
.
lexer
.
peekNextToken
();
if
(
n
.
type
===
r
.
tokens
.
directive
&&
n
.
endDirective
&&
this
.
createDirectiveNodeFromToken
(
n
).
directiveName
===
e
.
directiveName
)
return
this
.
lexer
.
getNextToken
(),
e
.
appendChild
(
this
.
createTextNode
(
t
.
join
(
"\n"
),
!
0
)),
e
;
t
.
push
(
this
.
lexer
.
stream
.
getNextLine
())}
throw
this
.
createErrorReport
(
"Unclosed directive "
+
e
.
directiveName
)},
parseDirectiveArguments
:
function
(
e
){
return
e
.
split
(
/[ ]+/
).
filter
((
function
(
e
){
return
e
.
length
&&
"-"
!==
e
[
0
]}))},
parseDirectiveOptions
:
function
(
e
){
return
e
.
split
(
/[ ]+/
).
filter
((
function
(
e
){
return
e
.
length
&&
"-"
===
e
[
0
]}))},
interpretDirective
:
function
(
e
){
switch
(
e
.
directiveName
){
case
"options:"
:
this
.
interpretOptionDirective
(
e
);
break
;
case
"title:"
:
this
.
document
.
title
=
e
.
directiveRawValue
;
break
;
case
"author:"
:
this
.
document
.
author
=
e
.
directiveRawValue
;
break
;
case
"email:"
:
this
.
document
.
email
=
e
.
directiveRawValue
;
break
;
default
:
this
.
document
.
directiveValues
[
e
.
directiveName
]
=
e
.
directiveRawValue
}},
interpretOptionDirective
:
function
(
e
){
e
.
directiveArguments
.
forEach
((
function
(
e
){
var
t
=
e
.
split
(
":"
);
this
.
options
[
t
[
0
]]
=
this
.
convertLispyValue
(
t
[
1
])}),
this
)},
convertLispyValue
:
function
(
e
){
switch
(
e
){
case
"t"
:
return
!
0
;
case
"nil"
:
return
!
1
;
default
:
return
/^[0-9]+$/
.
test
(
e
)
?
parseInt
(
e
)
:
e
}},
parseParagraph
:
function
(){
var
e
=
this
.
lexer
.
peekNextToken
(),
t
=
s
.
createParagraph
([]);
this
.
setNodeOriginFromToken
(
t
,
e
);
for
(
var
n
=
[];
this
.
lexer
.
hasNext
();){
var
i
=
this
.
lexer
.
peekNextToken
();
if
(
i
.
type
!==
r
.
tokens
.
line
||
i
.
indentation
<
e
.
indentation
)
break
;
this
.
lexer
.
getNextToken
(),
n
.
push
(
i
.
content
)}
return
t
.
appendChild
(
this
.
createTextNode
(
n
.
join
(
"\n"
))),
t
},
parseText
:
function
(
e
){
var
t
=
this
.
lexer
.
getNextToken
();
return
this
.
createTextNode
(
t
.
content
,
e
)},
createTextNode
:
function
(
e
,
t
){
return
t
?
s
.
createText
(
null
,{
value
:
e
})
:
this
.
inlineParser
.
parseEmphasis
(
e
)}},
o
.
prototype
.
originalParseElement
=
o
.
prototype
.
parseElement
,
a
.
prototype
=
{
parseEmphasis
:
function
(
e
){
var
t
=
this
.
emphasisPattern
;
t
.
lastIndex
=
0
;
for
(
var
n
,
i
,
r
=
[],
o
=
0
;
n
=
t
.
exec
(
e
);){
var
a
=
n
[
0
],
l
=
n
[
1
],
c
=
n
[
2
],
h
=
n
[
3
],
u
=
n
[
4
],
p
=
t
.
lastIndex
-
a
.
length
,
d
=
e
.
substring
(
o
,
p
+
l
.
length
);
i
=
t
.
lastIndex
,
r
.
push
(
this
.
parseLink
(
d
)),
t
.
lastIndex
=
i
;
var
f
=
[
s
.
createText
(
null
,{
value
:
h
})],
v
=
this
.
emphasizeElementByMarker
(
f
,
c
);
r
.
push
(
v
),
o
=
t
.
lastIndex
-
u
.
length
}
return
0
!==
t
.
lastIndex
&&
t
.
lastIndex
===
e
.
length
-
1
||
r
.
push
(
this
.
parseLink
(
e
.
substring
(
o
))),
1
===
r
.
length
?
r
[
0
]
:
s
.
createInlineContainer
(
r
)},
depth
:
0
,
parseLink
:
function
(
e
){
var
t
=
this
.
linkPattern
;
t
.
lastIndex
=
0
;
for
(
var
n
,
i
,
r
=
[],
o
=
0
;
n
=
t
.
exec
(
e
);){
var
a
=
n
[
0
],
l
=
n
[
1
],
c
=
n
[
2
],
h
=
t
.
lastIndex
-
a
.
length
,
u
=
e
.
substring
(
o
,
h
);
r
.
push
(
s
.
createText
(
null
,{
value
:
u
}));
var
p
=
s
.
createLink
([]);
p
.
src
=
l
,
c
?
(
i
=
t
.
lastIndex
,
p
.
appendChild
(
this
.
parseEmphasis
(
c
)),
t
.
lastIndex
=
i
)
:
p
.
appendChild
(
s
.
createText
(
null
,{
value
:
l
})),
r
.
push
(
p
),
o
=
t
.
lastIndex
}
return
0
!==
t
.
lastIndex
&&
t
.
lastIndex
===
e
.
length
-
1
||
r
.
push
(
s
.
createText
(
null
,{
value
:
e
.
substring
(
o
)})),
s
.
createInlineContainer
(
r
)},
emphasizeElementByMarker
:
function
(
e
,
t
){
switch
(
t
){
case
"*"
:
return
s
.
createBold
(
e
);
case
"/"
:
return
s
.
createItalic
(
e
);
case
"_"
:
return
s
.
createUnderline
(
e
);
case
"="
:
case
"~"
:
return
s
.
createCode
(
e
);
case
"+"
:
return
s
.
createDashed
(
e
)}},
buildEmphasisPattern
:
function
(){
return
new
RegExp
(
"(["
+
this
.
preEmphasis
+
"]|^|\r?\n)(["
+
this
.
markers
+
"])([^"
+
this
.
borderForbidden
+
"]|[^"
+
this
.
borderForbidden
+
"]"
+
this
.
bodyRegexp
+
"[^"
+
this
.
borderForbidden
+
"])\\2(["
+
this
.
postEmphasis
+
"]|$|\r?\n)"
,
"g"
)}},
t
.
Parser
=
o
,
t
.
InlineParser
=
a
},
56714
:
function
(
e
,
t
){
function
n
(
e
){
this
.
sequences
=
e
.
split
(
/\r?\n/
),
this
.
totalLines
=
this
.
sequences
.
length
,
this
.
lineNumber
=
0
}
n
.
prototype
.
peekNextLine
=
function
(){
return
this
.
hasNext
()
?
this
.
sequences
[
this
.
lineNumber
]
:
null
},
n
.
prototype
.
getNextLine
=
function
(){
return
this
.
hasNext
()
?
this
.
sequences
[
this
.
lineNumber
++
]
:
null
},
n
.
prototype
.
hasNext
=
function
(){
return
this
.
lineNumber
<
this
.
totalLines
},
t
.
Stream
=
n
}}]);
//# sourceMappingURL=org.b0aa3dbbf3faa5cf8a6d.js.map
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jul 4, 1:23 PM (6 d, 5 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3366855
Attached To
rDWAPPS Web applications
Event Timeline
Log In to Comment