@@ -902,14 +902,14 @@ function unescapeUrl(rawUrlString: string): string {
902
902
*/
903
903
function parseInline (
904
904
parse : MarkdownToJSX . NestedParser ,
905
- content : string ,
905
+ children : string ,
906
906
state : MarkdownToJSX . State
907
907
) : MarkdownToJSX . ParserResult [ ] {
908
908
const isCurrentlyInline = state . inline || false
909
909
const isCurrentlySimple = state . simple || false
910
910
state . inline = true
911
911
state . simple = true
912
- const result = parse ( content , state )
912
+ const result = parse ( children , state )
913
913
state . inline = isCurrentlyInline
914
914
state . simple = isCurrentlySimple
915
915
return result
@@ -920,33 +920,33 @@ function parseInline(
920
920
*/
921
921
function parseSimpleInline (
922
922
parse : MarkdownToJSX . NestedParser ,
923
- content : string ,
923
+ children : string ,
924
924
state : MarkdownToJSX . State
925
925
) : MarkdownToJSX . ParserResult [ ] {
926
926
const isCurrentlyInline = state . inline || false
927
927
const isCurrentlySimple = state . simple || false
928
928
state . inline = false
929
929
state . simple = true
930
- const result = parse ( content , state )
930
+ const result = parse ( children , state )
931
931
state . inline = isCurrentlyInline
932
932
state . simple = isCurrentlySimple
933
933
return result
934
934
}
935
935
936
936
function parseBlock (
937
937
parse ,
938
- content ,
938
+ children ,
939
939
state : MarkdownToJSX . State
940
940
) : MarkdownToJSX . ParserResult [ ] {
941
941
state . inline = false
942
- return parse ( content , state )
942
+ return parse ( children , state )
943
943
}
944
944
945
945
const parseCaptureInline : MarkdownToJSX . Parser < {
946
- content : MarkdownToJSX . ParserResult [ ]
946
+ children : MarkdownToJSX . ParserResult [ ]
947
947
} > = ( capture , parse , state : MarkdownToJSX . State ) => {
948
948
return {
949
- content : parseInline ( parse , capture [ 1 ] , state ) ,
949
+ children : parseInline ( parse , capture [ 1 ] , state ) ,
950
950
}
951
951
}
952
952
@@ -1205,15 +1205,17 @@ export function compiler(
1205
1205
order : Priority . HIGH ,
1206
1206
parse ( capture , parse , state ) {
1207
1207
return {
1208
- content : parse (
1208
+ children : parse (
1209
1209
capture [ 0 ] . replace ( BLOCKQUOTE_TRIM_LEFT_MULTILINE_R , '' ) ,
1210
1210
state
1211
1211
) ,
1212
1212
}
1213
1213
} ,
1214
1214
render ( node , output , state ) {
1215
1215
return (
1216
- < blockquote key = { state . key } > { output ( node . content , state ) } </ blockquote >
1216
+ < blockquote key = { state . key } >
1217
+ { output ( node . children , state ) }
1218
+ </ blockquote >
1217
1219
)
1218
1220
} ,
1219
1221
} ,
@@ -1353,7 +1355,7 @@ export function compiler(
1353
1355
order : Priority . HIGH ,
1354
1356
parse ( capture , parse , state ) {
1355
1357
return {
1356
- content : parseInline ( parse , capture [ 2 ] , state ) ,
1358
+ children : parseInline ( parse , capture [ 2 ] , state ) ,
1357
1359
id : options . slugify ( capture [ 2 ] ) ,
1358
1360
level : capture [ 1 ] . length as MarkdownToJSX . HeadingNode [ 'level' ] ,
1359
1361
}
@@ -1362,7 +1364,7 @@ export function compiler(
1362
1364
return h (
1363
1365
`h${ node . level } ` ,
1364
1366
{ id : node . id , key : state . key } ,
1365
- output ( node . content , state )
1367
+ output ( node . children , state )
1366
1368
)
1367
1369
} ,
1368
1370
} ,
@@ -1372,7 +1374,7 @@ export function compiler(
1372
1374
order : Priority . MAX ,
1373
1375
parse ( capture , parse , state ) {
1374
1376
return {
1375
- content : parseInline ( parse , capture [ 1 ] , state ) ,
1377
+ children : parseInline ( parse , capture [ 1 ] , state ) ,
1376
1378
level : capture [ 2 ] === '=' ? 1 : 2 ,
1377
1379
type : RuleType . heading ,
1378
1380
}
@@ -1404,7 +1406,7 @@ export function compiler(
1404
1406
tag : noInnerParse ? tagName : capture [ 1 ] ,
1405
1407
} as {
1406
1408
attrs : ReturnType < typeof attrStringToMap >
1407
- content ?: ReturnType < MarkdownToJSX . NestedParser > | undefined
1409
+ children ?: ReturnType < MarkdownToJSX . NestedParser > | undefined
1408
1410
noInnerParse : Boolean
1409
1411
tag : MarkdownToJSX . HTMLTags
1410
1412
text ?: string | undefined
@@ -1415,7 +1417,7 @@ export function compiler(
1415
1417
if ( noInnerParse ) {
1416
1418
ast . text = capture [ 3 ]
1417
1419
} else {
1418
- ast . content = parseFunc ( parse , trimmed , state )
1420
+ ast . children = parseFunc ( parse , trimmed , state )
1419
1421
}
1420
1422
1421
1423
/**
@@ -1429,7 +1431,7 @@ export function compiler(
1429
1431
render ( node , output , state ) {
1430
1432
return (
1431
1433
< node . tag key = { state . key } { ...node . attrs } >
1432
- { node . text || output ( node . content , state ) }
1434
+ { node . text || output ( node . children , state ) }
1433
1435
</ node . tag >
1434
1436
)
1435
1437
} ,
@@ -1492,15 +1494,15 @@ export function compiler(
1492
1494
order : Priority . LOW ,
1493
1495
parse ( capture , parse , state ) {
1494
1496
return {
1495
- content : parseSimpleInline ( parse , capture [ 1 ] , state ) ,
1497
+ children : parseSimpleInline ( parse , capture [ 1 ] , state ) ,
1496
1498
target : unescapeUrl ( capture [ 2 ] ) ,
1497
1499
title : capture [ 3 ] ,
1498
1500
}
1499
1501
} ,
1500
1502
render ( node , output , state ) {
1501
1503
return (
1502
1504
< a key = { state . key } href = { sanitizeUrl ( node . target ) } title = { node . title } >
1503
- { output ( node . content , state ) }
1505
+ { output ( node . children , state ) }
1504
1506
</ a >
1505
1507
)
1506
1508
} ,
@@ -1512,7 +1514,7 @@ export function compiler(
1512
1514
order : Priority . MAX ,
1513
1515
parse ( capture /*, parse, state*/ ) {
1514
1516
return {
1515
- content : [
1517
+ children : [
1516
1518
{
1517
1519
text : capture [ 1 ] ,
1518
1520
type : RuleType . text ,
@@ -1534,7 +1536,7 @@ export function compiler(
1534
1536
order : Priority . MAX ,
1535
1537
parse ( capture /*, parse, state*/ ) {
1536
1538
return {
1537
- content : [
1539
+ children : [
1538
1540
{
1539
1541
text : capture [ 1 ] ,
1540
1542
type : RuleType . text ,
@@ -1560,7 +1562,7 @@ export function compiler(
1560
1562
}
1561
1563
1562
1564
return {
1563
- content : [
1565
+ children : [
1564
1566
{
1565
1567
text : address . replace ( 'mailto:' , '' ) ,
1566
1568
type : RuleType . text ,
@@ -1596,7 +1598,7 @@ export function compiler(
1596
1598
order : Priority . LOW ,
1597
1599
parse : parseCaptureInline ,
1598
1600
render ( node , output , state ) {
1599
- return < p key = { state . key } > { output ( node . content , state ) } </ p >
1601
+ return < p key = { state . key } > { output ( node . children , state ) } </ p >
1600
1602
} ,
1601
1603
} as MarkdownToJSX . Rule < ReturnType < typeof parseCaptureInline > > ,
1602
1604
@@ -1640,8 +1642,8 @@ export function compiler(
1640
1642
order : Priority . MAX ,
1641
1643
parse ( capture , parse , state ) {
1642
1644
return {
1643
- content : parse ( capture [ 1 ] , state ) ,
1644
- fallbackContent : parse (
1645
+ children : parse ( capture [ 1 ] , state ) ,
1646
+ fallbackChildren : parse (
1645
1647
capture [ 0 ] . replace ( SQUARE_BRACKETS_R , '\\$1' ) ,
1646
1648
state
1647
1649
) ,
@@ -1655,10 +1657,10 @@ export function compiler(
1655
1657
href = { sanitizeUrl ( refs [ node . ref ] . target ) }
1656
1658
title = { refs [ node . ref ] . title }
1657
1659
>
1658
- { output ( node . content , state ) }
1660
+ { output ( node . children , state ) }
1659
1661
</ a >
1660
1662
) : (
1661
- < span key = { state . key } > { output ( node . fallbackContent , state ) } </ span >
1663
+ < span key = { state . key } > { output ( node . fallbackChildren , state ) } </ span >
1662
1664
)
1663
1665
} ,
1664
1666
} ,
@@ -1750,11 +1752,11 @@ export function compiler(
1750
1752
return {
1751
1753
// capture[1] -> the syntax control character
1752
1754
// capture[2] -> inner content
1753
- content : parse ( capture [ 2 ] , state ) ,
1755
+ children : parse ( capture [ 2 ] , state ) ,
1754
1756
}
1755
1757
} ,
1756
1758
render ( node , output , state ) {
1757
- return < strong key = { state . key } > { output ( node . content , state ) } </ strong >
1759
+ return < strong key = { state . key } > { output ( node . children , state ) } </ strong >
1758
1760
} ,
1759
1761
} ,
1760
1762
@@ -1765,11 +1767,11 @@ export function compiler(
1765
1767
return {
1766
1768
// capture[1] -> opening * or _
1767
1769
// capture[2] -> inner content
1768
- content : parse ( capture [ 2 ] , state ) ,
1770
+ children : parse ( capture [ 2 ] , state ) ,
1769
1771
}
1770
1772
} ,
1771
1773
render ( node , output , state ) {
1772
- return < em key = { state . key } > { output ( node . content , state ) } </ em >
1774
+ return < em key = { state . key } > { output ( node . children , state ) } </ em >
1773
1775
} ,
1774
1776
} ,
1775
1777
@@ -1793,7 +1795,7 @@ export function compiler(
1793
1795
order : Priority . LOW ,
1794
1796
parse : parseCaptureInline ,
1795
1797
render ( node , output , state ) {
1796
- return < mark key = { state . key } > { output ( node . content , state ) } </ mark >
1798
+ return < mark key = { state . key } > { output ( node . children , state ) } </ mark >
1797
1799
} ,
1798
1800
} ,
1799
1801
@@ -1802,7 +1804,7 @@ export function compiler(
1802
1804
order : Priority . LOW ,
1803
1805
parse : parseCaptureInline ,
1804
1806
render ( node , output , state ) {
1805
- return < del key = { state . key } > { output ( node . content , state ) } </ del >
1807
+ return < del key = { state . key } > { output ( node . children , state ) } </ del >
1806
1808
} ,
1807
1809
} ,
1808
1810
}
@@ -1922,7 +1924,7 @@ export namespace MarkdownToJSX {
1922
1924
}
1923
1925
1924
1926
export interface BlockQuoteNode {
1925
- content : MarkdownToJSX . ParserResult [ ]
1927
+ children : MarkdownToJSX . ParserResult [ ]
1926
1928
type : ( typeof RuleType ) [ 'blockQuote' ]
1927
1929
}
1928
1930
@@ -1967,7 +1969,7 @@ export namespace MarkdownToJSX {
1967
1969
1968
1970
export interface HeadingNode {
1969
1971
type : ( typeof RuleType ) [ 'heading' ]
1970
- content : MarkdownToJSX . ParserResult [ ]
1972
+ children : MarkdownToJSX . ParserResult [ ]
1971
1973
id : string
1972
1974
level : 1 | 2 | 3 | 4 | 5 | 6
1973
1975
}
@@ -1989,7 +1991,7 @@ export namespace MarkdownToJSX {
1989
1991
1990
1992
export interface LinkNode {
1991
1993
type : ( typeof RuleType ) [ 'link' ]
1992
- content : MarkdownToJSX . ParserResult [ ]
1994
+ children : MarkdownToJSX . ParserResult [ ]
1993
1995
target : string
1994
1996
title ?: string
1995
1997
}
@@ -2025,7 +2027,7 @@ export namespace MarkdownToJSX {
2025
2027
2026
2028
export interface ParagraphNode {
2027
2029
type : ( typeof RuleType ) [ 'paragraph' ]
2028
- content : MarkdownToJSX . ParserResult [ ]
2030
+ children : MarkdownToJSX . ParserResult [ ]
2029
2031
}
2030
2032
2031
2033
export interface ReferenceNode {
@@ -2040,8 +2042,8 @@ export namespace MarkdownToJSX {
2040
2042
2041
2043
export interface ReferenceLinkNode {
2042
2044
type : ( typeof RuleType ) [ 'refLink' ]
2043
- content : MarkdownToJSX . ParserResult [ ]
2044
- fallbackContent : MarkdownToJSX . ParserResult [ ]
2045
+ children : MarkdownToJSX . ParserResult [ ]
2046
+ fallbackChildren : MarkdownToJSX . ParserResult [ ]
2045
2047
ref : string
2046
2048
}
2047
2049
@@ -2066,12 +2068,12 @@ export namespace MarkdownToJSX {
2066
2068
2067
2069
export interface BoldTextNode {
2068
2070
type : ( typeof RuleType ) [ 'textBolded' ]
2069
- content : MarkdownToJSX . ParserResult [ ]
2071
+ children : MarkdownToJSX . ParserResult [ ]
2070
2072
}
2071
2073
2072
2074
export interface ItalicTextNode {
2073
2075
type : ( typeof RuleType ) [ 'textEmphasized' ]
2074
- content : MarkdownToJSX . ParserResult [ ]
2076
+ children : MarkdownToJSX . ParserResult [ ]
2075
2077
}
2076
2078
2077
2079
export interface EscapedTextNode {
@@ -2080,18 +2082,18 @@ export namespace MarkdownToJSX {
2080
2082
2081
2083
export interface MarkedTextNode {
2082
2084
type : ( typeof RuleType ) [ 'textMarked' ]
2083
- content : MarkdownToJSX . ParserResult [ ]
2085
+ children : MarkdownToJSX . ParserResult [ ]
2084
2086
}
2085
2087
2086
2088
export interface StrikethroughTextNode {
2087
2089
type : ( typeof RuleType ) [ 'textStrikethroughed' ]
2088
- content : MarkdownToJSX . ParserResult [ ]
2090
+ children : MarkdownToJSX . ParserResult [ ]
2089
2091
}
2090
2092
2091
2093
export interface HTMLNode {
2092
2094
type : ( typeof RuleType ) [ 'htmlBlock' ]
2093
2095
attrs : JSX . IntrinsicAttributes
2094
- content ?: ReturnType < MarkdownToJSX . NestedParser > | undefined
2096
+ children ?: ReturnType < MarkdownToJSX . NestedParser > | undefined
2095
2097
noInnerParse : Boolean
2096
2098
tag : MarkdownToJSX . HTMLTags
2097
2099
text ?: string | undefined
0 commit comments