wikiparser-node 1.13.0 → 1.13.1-b

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.
Files changed (176) hide show
  1. package/bundle/bundle.min.js +37 -0
  2. package/config/default.json +32 -41
  3. package/config/enwiki.json +17 -839
  4. package/config/llwiki.json +21 -56
  5. package/config/moegirl.json +21 -65
  6. package/config/zhwiki.json +32 -498
  7. package/extensions/dist/base.js +163 -0
  8. package/extensions/dist/codejar.js +53 -0
  9. package/extensions/dist/editor.js +159 -0
  10. package/extensions/dist/highlight.js +30 -0
  11. package/extensions/dist/lint.js +72 -0
  12. package/extensions/editor.css +59 -0
  13. package/extensions/ui.css +162 -0
  14. package/i18n/zh-hans.json +1 -0
  15. package/i18n/zh-hant.json +1 -0
  16. package/package.json +29 -22
  17. package/config/.schema.json +0 -203
  18. package/dist/addon/table.js +0 -494
  19. package/dist/addon/token.js +0 -392
  20. package/dist/addon/transclude.js +0 -184
  21. package/dist/base.d.ts +0 -109
  22. package/dist/base.js +0 -67
  23. package/dist/index.d.ts +0 -33
  24. package/dist/index.js +0 -279
  25. package/dist/internal.d.ts +0 -47
  26. package/dist/lib/element.d.ts +0 -125
  27. package/dist/lib/element.js +0 -364
  28. package/dist/lib/node.d.ts +0 -173
  29. package/dist/lib/node.js +0 -478
  30. package/dist/lib/range.d.ts +0 -105
  31. package/dist/lib/range.js +0 -406
  32. package/dist/lib/ranges.d.ts +0 -28
  33. package/dist/lib/ranges.js +0 -126
  34. package/dist/lib/rect.d.ts +0 -18
  35. package/dist/lib/rect.js +0 -36
  36. package/dist/lib/text.d.ts +0 -58
  37. package/dist/lib/text.js +0 -414
  38. package/dist/lib/title.d.ts +0 -49
  39. package/dist/lib/title.js +0 -251
  40. package/dist/mixin/attributesParent.d.ts +0 -49
  41. package/dist/mixin/attributesParent.js +0 -80
  42. package/dist/mixin/fixed.d.ts +0 -5
  43. package/dist/mixin/fixed.js +0 -32
  44. package/dist/mixin/flagsParent.d.ts +0 -43
  45. package/dist/mixin/flagsParent.js +0 -64
  46. package/dist/mixin/hidden.d.ts +0 -7
  47. package/dist/mixin/hidden.js +0 -39
  48. package/dist/mixin/magicLinkParent.d.ts +0 -19
  49. package/dist/mixin/magicLinkParent.js +0 -43
  50. package/dist/mixin/singleLine.d.ts +0 -5
  51. package/dist/mixin/singleLine.js +0 -25
  52. package/dist/mixin/sol.d.ts +0 -6
  53. package/dist/mixin/sol.js +0 -45
  54. package/dist/mixin/syntax.d.ts +0 -8
  55. package/dist/mixin/syntax.js +0 -46
  56. package/dist/parser/braces.js +0 -152
  57. package/dist/parser/commentAndExt.js +0 -84
  58. package/dist/parser/converter.js +0 -41
  59. package/dist/parser/externalLinks.js +0 -39
  60. package/dist/parser/hrAndDoubleUnderscore.js +0 -44
  61. package/dist/parser/html.js +0 -40
  62. package/dist/parser/links.js +0 -103
  63. package/dist/parser/list.js +0 -116
  64. package/dist/parser/magicLinks.js +0 -55
  65. package/dist/parser/quotes.js +0 -69
  66. package/dist/parser/redirect.js +0 -28
  67. package/dist/parser/selector.js +0 -443
  68. package/dist/parser/table.js +0 -125
  69. package/dist/src/arg.d.ts +0 -49
  70. package/dist/src/arg.js +0 -220
  71. package/dist/src/atom.d.ts +0 -14
  72. package/dist/src/atom.js +0 -54
  73. package/dist/src/attribute.d.ts +0 -64
  74. package/dist/src/attribute.js +0 -482
  75. package/dist/src/attributes.d.ts +0 -103
  76. package/dist/src/attributes.js +0 -383
  77. package/dist/src/converter.d.ts +0 -28
  78. package/dist/src/converter.js +0 -153
  79. package/dist/src/converterFlags.d.ts +0 -80
  80. package/dist/src/converterFlags.js +0 -241
  81. package/dist/src/converterRule.d.ts +0 -71
  82. package/dist/src/converterRule.js +0 -218
  83. package/dist/src/extLink.d.ts +0 -36
  84. package/dist/src/extLink.js +0 -223
  85. package/dist/src/gallery.d.ts +0 -51
  86. package/dist/src/gallery.js +0 -166
  87. package/dist/src/heading.d.ts +0 -44
  88. package/dist/src/heading.js +0 -222
  89. package/dist/src/hidden.d.ts +0 -9
  90. package/dist/src/hidden.js +0 -82
  91. package/dist/src/html.d.ts +0 -61
  92. package/dist/src/html.js +0 -344
  93. package/dist/src/imageParameter.d.ts +0 -60
  94. package/dist/src/imageParameter.js +0 -262
  95. package/dist/src/imagemap.d.ts +0 -47
  96. package/dist/src/imagemap.js +0 -148
  97. package/dist/src/imagemapLink.d.ts +0 -35
  98. package/dist/src/imagemapLink.js +0 -99
  99. package/dist/src/index.d.ts +0 -136
  100. package/dist/src/index.js +0 -790
  101. package/dist/src/link/base.d.ts +0 -52
  102. package/dist/src/link/base.js +0 -258
  103. package/dist/src/link/category.d.ts +0 -22
  104. package/dist/src/link/category.js +0 -36
  105. package/dist/src/link/file.d.ts +0 -102
  106. package/dist/src/link/file.js +0 -345
  107. package/dist/src/link/galleryImage.d.ts +0 -29
  108. package/dist/src/link/galleryImage.js +0 -133
  109. package/dist/src/link/index.d.ts +0 -39
  110. package/dist/src/link/index.js +0 -100
  111. package/dist/src/link/redirectTarget.d.ts +0 -27
  112. package/dist/src/link/redirectTarget.js +0 -71
  113. package/dist/src/magicLink.d.ts +0 -57
  114. package/dist/src/magicLink.js +0 -261
  115. package/dist/src/nested.d.ts +0 -40
  116. package/dist/src/nested.js +0 -108
  117. package/dist/src/nowiki/base.d.ts +0 -28
  118. package/dist/src/nowiki/base.js +0 -90
  119. package/dist/src/nowiki/comment.d.ts +0 -14
  120. package/dist/src/nowiki/comment.js +0 -123
  121. package/dist/src/nowiki/dd.d.ts +0 -8
  122. package/dist/src/nowiki/dd.js +0 -74
  123. package/dist/src/nowiki/doubleUnderscore.d.ts +0 -15
  124. package/dist/src/nowiki/doubleUnderscore.js +0 -101
  125. package/dist/src/nowiki/hr.d.ts +0 -5
  126. package/dist/src/nowiki/hr.js +0 -72
  127. package/dist/src/nowiki/index.d.ts +0 -14
  128. package/dist/src/nowiki/index.js +0 -30
  129. package/dist/src/nowiki/list.d.ts +0 -5
  130. package/dist/src/nowiki/list.js +0 -67
  131. package/dist/src/nowiki/listBase.d.ts +0 -23
  132. package/dist/src/nowiki/listBase.js +0 -100
  133. package/dist/src/nowiki/noinclude.d.ts +0 -6
  134. package/dist/src/nowiki/noinclude.js +0 -77
  135. package/dist/src/nowiki/quote.d.ts +0 -14
  136. package/dist/src/nowiki/quote.js +0 -149
  137. package/dist/src/onlyinclude.d.ts +0 -13
  138. package/dist/src/onlyinclude.js +0 -60
  139. package/dist/src/paramTag/index.d.ts +0 -28
  140. package/dist/src/paramTag/index.js +0 -80
  141. package/dist/src/paramTag/inputbox.d.ts +0 -8
  142. package/dist/src/paramTag/inputbox.js +0 -24
  143. package/dist/src/parameter.d.ts +0 -60
  144. package/dist/src/parameter.js +0 -267
  145. package/dist/src/pre.d.ts +0 -28
  146. package/dist/src/pre.js +0 -62
  147. package/dist/src/redirect.d.ts +0 -30
  148. package/dist/src/redirect.js +0 -128
  149. package/dist/src/syntax.d.ts +0 -15
  150. package/dist/src/syntax.js +0 -87
  151. package/dist/src/table/base.d.ts +0 -28
  152. package/dist/src/table/base.js +0 -81
  153. package/dist/src/table/index.d.ts +0 -230
  154. package/dist/src/table/index.js +0 -506
  155. package/dist/src/table/td.d.ts +0 -72
  156. package/dist/src/table/td.js +0 -375
  157. package/dist/src/table/tr.d.ts +0 -30
  158. package/dist/src/table/tr.js +0 -61
  159. package/dist/src/table/trBase.d.ts +0 -49
  160. package/dist/src/table/trBase.js +0 -165
  161. package/dist/src/tagPair/ext.d.ts +0 -29
  162. package/dist/src/tagPair/ext.js +0 -229
  163. package/dist/src/tagPair/include.d.ts +0 -33
  164. package/dist/src/tagPair/include.js +0 -132
  165. package/dist/src/tagPair/index.d.ts +0 -23
  166. package/dist/src/tagPair/index.js +0 -130
  167. package/dist/src/transclude.d.ts +0 -159
  168. package/dist/src/transclude.js +0 -598
  169. package/dist/util/constants.js +0 -26
  170. package/dist/util/debug.js +0 -95
  171. package/dist/util/diff.js +0 -83
  172. package/dist/util/html.js +0 -146
  173. package/dist/util/lint.js +0 -32
  174. package/dist/util/string.js +0 -107
  175. package/errors/README +0 -3
  176. package/printed/README +0 -3
@@ -668,7 +668,36 @@
668
668
  ]
669
669
  ],
670
670
  "doubleUnderscore": [
671
- [],
671
+ [
672
+ "forcetoc",
673
+ "强显目录",
674
+ "強制目錄",
675
+ "nocc",
676
+ "nocontentconvert",
677
+ "不转换内容",
678
+ "不轉換內容",
679
+ "noeditsection",
680
+ "无段落编辑",
681
+ "无编辑段落",
682
+ "無段落編輯",
683
+ "nogallery",
684
+ "无图库",
685
+ "無圖庫",
686
+ "notc",
687
+ "notitleconvert",
688
+ "不转换标题",
689
+ "不轉換標題",
690
+ "notoc",
691
+ "无目录",
692
+ "無目錄",
693
+ "toc",
694
+ "目录",
695
+ "目錄",
696
+ "archivedtalk",
697
+ "已存档讨论",
698
+ "notalk",
699
+ "禁用讨论"
700
+ ],
672
701
  [
673
702
  "EXPECTUNUSEDCATEGORY",
674
703
  "DISAMBIG",
@@ -691,505 +720,10 @@
691
720
  "禁用全域用户页",
692
721
  "EXPECTED_UNCONNECTED_PAGE",
693
722
  "EXPECTUNUSEDTEMPLATE"
694
- ],
695
- {
696
- "forcetoc": "forcetoc",
697
- "强显目录": "forcetoc",
698
- "強制目錄": "forcetoc",
699
- "nocc": "nocontentconvert",
700
- "nocontentconvert": "nocontentconvert",
701
- "不转换内容": "nocontentconvert",
702
- "不轉換內容": "nocontentconvert",
703
- "noeditsection": "noeditsection",
704
- "无段落编辑": "noeditsection",
705
- "无编辑段落": "noeditsection",
706
- "無段落編輯": "noeditsection",
707
- "nogallery": "nogallery",
708
- "无图库": "nogallery",
709
- "無圖庫": "nogallery",
710
- "notc": "notitleconvert",
711
- "notitleconvert": "notitleconvert",
712
- "不转换标题": "notitleconvert",
713
- "不轉換標題": "notitleconvert",
714
- "notoc": "notoc",
715
- "无目录": "notoc",
716
- "無目錄": "notoc",
717
- "toc": "toc",
718
- "目录": "toc",
719
- "目錄": "toc",
720
- "archivedtalk": "archivedtalk",
721
- "已存档讨论": "archivedtalk",
722
- "notalk": "notalk",
723
- "禁用讨论": "notalk"
724
- }
723
+ ]
725
724
  ],
726
725
  "protocol": "bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",
727
- "interwiki": [
728
- "acronym",
729
- "advisory",
730
- "advogato",
731
- "aew",
732
- "appropedia",
733
- "aquariumwiki",
734
- "arborwiki",
735
- "arxiv",
736
- "baden",
737
- "battlestarwiki",
738
- "bcnbio",
739
- "beacha",
740
- "betawiki",
741
- "bibcode",
742
- "bibliowiki",
743
- "bluwiki",
744
- "botwiki",
745
- "boxrec",
746
- "bugzilla",
747
- "bulba",
748
- "c",
749
- "c2",
750
- "c2find",
751
- "cache",
752
- "ĉej",
753
- "centralwikia",
754
- "chej",
755
- "choralwiki",
756
- "citizendium",
757
- "comixpedia",
758
- "commons",
759
- "communityscheme",
760
- "communitywiki",
761
- "comune",
762
- "creativecommons",
763
- "creativecommonswiki",
764
- "cxej",
765
- "dcc",
766
- "dcdatabase",
767
- "dcma",
768
- "debian",
769
- "delicious",
770
- "devmo",
771
- "dico",
772
- "dicoado",
773
- "dictionary",
774
- "dict",
775
- "disinfopedia",
776
- "distributedproofreaders",
777
- "distributedproofreadersca",
778
- "dmoz",
779
- "dmozs",
780
- "doi",
781
- "donate",
782
- "doom_wiki",
783
- "download",
784
- "dbdump",
785
- "dpd",
786
- "dpla",
787
- "drae",
788
- "dreamhost",
789
- "drumcorpswiki",
790
- "dwjwiki",
791
- "ecoreality",
792
- "elibre",
793
- "emacswiki",
794
- "encyc",
795
- "energiewiki",
796
- "englyphwiki",
797
- "enkol",
798
- "eokulturcentro",
799
- "esolang",
800
- "etherpad",
801
- "ethnologue",
802
- "ethnologuefamily",
803
- "evowiki",
804
- "exotica",
805
- "fanimutationwiki",
806
- "fedora",
807
- "finalfantasy",
808
- "finnix",
809
- "flickruser",
810
- "flickrphoto",
811
- "floralwiki",
812
- "foldoc",
813
- "foundation",
814
- "foundationsite",
815
- "foxwiki",
816
- "freebio",
817
- "freebsdman",
818
- "freeculturewiki",
819
- "freedomdefined",
820
- "freefeel",
821
- "freekiwiki",
822
- "freenode",
823
- "freesoft",
824
- "ganfyd",
825
- "gardenology",
826
- "gausswiki",
827
- "gentoo",
828
- "genwiki",
829
- "gerrit",
830
- "git",
831
- "gitlab",
832
- "globalcontribs",
833
- "glottolog",
834
- "glottopedia",
835
- "google",
836
- "googledefine",
837
- "googlegroups",
838
- "guildwarswiki",
839
- "guildwiki",
840
- "gucprefix",
841
- "gutenberg",
842
- "gutenbergwiki",
843
- "hackerspaces",
844
- "h2wiki",
845
- "hammondwiki",
846
- "hdl",
847
- "heraldik",
848
- "horizonlabs",
849
- "hrwiki",
850
- "hrfwiki",
851
- "hupwiki",
852
- "iarchive",
853
- "imdbname",
854
- "imdbtitle",
855
- "imdbcompany",
856
- "imdbcharacter",
857
- "incubator",
858
- "infosecpedia",
859
- "infosphere",
860
- "irc",
861
- "ircs",
862
- "ircrc",
863
- "rcirc",
864
- "iso639-3",
865
- "issn",
866
- "iuridictum",
867
- "jaglyphwiki",
868
- "jefo",
869
- "jerseydatabase",
870
- "jira",
871
- "jspwiki",
872
- "jstor",
873
- "kamelo",
874
- "karlsruhe",
875
- "kinowiki",
876
- "komicawiki",
877
- "kontuwiki",
878
- "lexemes",
879
- "liberachat",
880
- "libreplanet",
881
- "lingualibre",
882
- "linguistlist",
883
- "linuxwiki",
884
- "linuxwikide",
885
- "listarchive",
886
- "liswiki",
887
- "literateprograms",
888
- "livepedia",
889
- "localwiki",
890
- "lojban",
891
- "lokalhistoriewiki",
892
- "lostpedia",
893
- "lqwiki",
894
- "luxo",
895
- "mail",
896
- "mailarchive",
897
- "mariowiki",
898
- "marveldatabase",
899
- "meatball",
900
- "mw",
901
- "mediazilla",
902
- "memoryalpha",
903
- "metawiki",
904
- "metawikimedia",
905
- "metawikipedia",
906
- "mineralienatlas",
907
- "mixnmatch",
908
- "moinmoin",
909
- "monstropedia",
910
- "mosapedia",
911
- "mozcom",
912
- "mozillawiki",
913
- "mozillazinekb",
914
- "musicbrainz",
915
- "mediawikiwiki",
916
- "mwod",
917
- "mwot",
918
- "nkcells",
919
- "nlab",
920
- "nara",
921
- "nosmoke",
922
- "nost",
923
- "nostalgia",
924
- "oeis",
925
- "oldwikisource",
926
- "olpc",
927
- "omegawiki",
928
- "onelook",
929
- "openlibrary",
930
- "openstreetmap",
931
- "openwetware",
932
- "opera7wiki",
933
- "organicdesign",
934
- "orthodoxwiki",
935
- "osmwiki",
936
- "otrs",
937
- "otrswiki",
938
- "ourmedia",
939
- "outreach",
940
- "outreachwiki",
941
- "owasp",
942
- "panawiki",
943
- "patwiki",
944
- "paws",
945
- "personaltelco",
946
- "petscan",
947
- "phab",
948
- "phabricator",
949
- "phwiki",
950
- "phpwiki",
951
- "planetmath",
952
- "pmeg",
953
- "pmid",
954
- "pokewiki",
955
- "pokéwiki",
956
- "policy",
957
- "proofwiki",
958
- "pyrev",
959
- "pythoninfo",
960
- "pythonwiki",
961
- "pywiki",
962
- "quality",
963
- "quarry",
964
- "regiowiki",
965
- "rev",
966
- "revo",
967
- "rfc",
968
- "rheinneckar",
969
- "robowiki",
970
- "rodovid",
971
- "rowiki",
972
- "rt",
973
- "s23wiki",
974
- "scholar",
975
- "schoolswp",
976
- "scores",
977
- "scoutwiki",
978
- "scramble",
979
- "seapig",
980
- "seattlewiki",
981
- "slwiki",
982
- "semantic-mw",
983
- "senseislibrary",
984
- "sep11",
985
- "sharemap",
986
- "silcode",
987
- "slashdot",
988
- "sourceforge",
989
- "spcom",
990
- "species",
991
- "squeak",
992
- "stats",
993
- "stewardry",
994
- "strategy",
995
- "strategywiki",
996
- "sulutil",
997
- "swtrain",
998
- "svn",
999
- "swinbrain",
1000
- "tabwiki",
1001
- "tclerswiki",
1002
- "technorati",
1003
- "tenwiki",
1004
- "testwiki",
1005
- "testwikidata",
1006
- "test2wiki",
1007
- "tfwiki",
1008
- "thelemapedia",
1009
- "theopedia",
1010
- "thinkwiki",
1011
- "ticket",
1012
- "tmbw",
1013
- "tmnet",
1014
- "tmwiki",
1015
- "toolforge",
1016
- "toollabs",
1017
- "tools",
1018
- "tswiki",
1019
- "translatewiki",
1020
- "tviv",
1021
- "tvtropes",
1022
- "twiki",
1023
- "twl",
1024
- "tyvawiki",
1025
- "umap",
1026
- "uncyclopedia",
1027
- "unihan",
1028
- "unreal",
1029
- "urbandict",
1030
- "usej",
1031
- "usemod",
1032
- "usability",
1033
- "utrs",
1034
- "vikidia",
1035
- "viaf",
1036
- "vlos",
1037
- "vkol",
1038
- "votewiki",
1039
- "vrtwiki",
1040
- "vrts",
1041
- "weirdgloop",
1042
- "werelate",
1043
- "wg",
1044
- "wikia",
1045
- "wikiasite",
1046
- "wikiapiary",
1047
- "wikibooks",
1048
- "wikichristian",
1049
- "wikicities",
1050
- "wikicity",
1051
- "wikiconference",
1052
- "wikidata",
1053
- "wikiedudashboard",
1054
- "wikif1",
1055
- "wikifur",
1056
- "wikihow",
1057
- "wikiindex",
1058
- "wikilemon",
1059
- "wikilivres",
1060
- "wikilivresru",
1061
- "wikimac-de",
1062
- "wikimedia",
1063
- "wikinews",
1064
- "wikinfo",
1065
- "wikinvest",
1066
- "wikiotics",
1067
- "wikipapers",
1068
- "wikipedia",
1069
- "wikipediawikipedia",
1070
- "wikiquote",
1071
- "wikisophia",
1072
- "wikisource",
1073
- "wikisp",
1074
- "wikispecies",
1075
- "wikispot",
1076
- "wikiskripta",
1077
- "wikitech",
1078
- "labsconsole",
1079
- "wikiti",
1080
- "wikiversity",
1081
- "wikivoyage",
1082
- "betawikiversity",
1083
- "wikiwikiweb",
1084
- "wiktionary",
1085
- "wlug",
1086
- "wmam",
1087
- "wmar",
1088
- "wmat",
1089
- "wmau",
1090
- "wmbd",
1091
- "wmbe",
1092
- "wmbr",
1093
- "wmca",
1094
- "wmch",
1095
- "wmcl",
1096
- "wmcn",
1097
- "wmco",
1098
- "wmcz",
1099
- "wmcz_docs",
1100
- "wmcz_old",
1101
- "wmdc",
1102
- "securewikidc",
1103
- "wmde",
1104
- "wmdk",
1105
- "wmee",
1106
- "wmec",
1107
- "wmes",
1108
- "wmet",
1109
- "wmfdashboard",
1110
- "wmfi",
1111
- "wmfr",
1112
- "wmge",
1113
- "wmhi",
1114
- "wmhk",
1115
- "wmhu",
1116
- "wmid",
1117
- "wmil",
1118
- "wmin",
1119
- "wmit",
1120
- "wmke",
1121
- "wmmk",
1122
- "wmmx",
1123
- "wmnl",
1124
- "wmnyc",
1125
- "wmno",
1126
- "wmpa-us",
1127
- "wmph",
1128
- "wmpl",
1129
- "wmplsite",
1130
- "wmpt",
1131
- "wmpunjabi",
1132
- "wmromd",
1133
- "wmrs",
1134
- "wmru",
1135
- "wmse",
1136
- "wmsk",
1137
- "wmtr",
1138
- "wmtw",
1139
- "wmua",
1140
- "wmuk",
1141
- "wmve",
1142
- "wmza",
1143
- "wm2005",
1144
- "wm2006",
1145
- "wm2007",
1146
- "wm2008",
1147
- "wm2009",
1148
- "wm2010",
1149
- "wm2011",
1150
- "wm2012",
1151
- "wm2013",
1152
- "wm2014",
1153
- "wm2015",
1154
- "wm2016",
1155
- "wm2017",
1156
- "wm2018",
1157
- "wmania",
1158
- "wikimania",
1159
- "wikispore",
1160
- "wmteam",
1161
- "wmf",
1162
- "wmfblog",
1163
- "wmdeblog",
1164
- "wookieepedia",
1165
- "wowwiki",
1166
- "wqy",
1167
- "wurmpedia",
1168
- "xtools",
1169
- "zrhwiki",
1170
- "zum",
1171
- "zwiki",
1172
- "m",
1173
- "meta",
1174
- "d",
1175
- "cz",
1176
- "dk",
1177
- "epo",
1178
- "jp",
1179
- "minnan",
1180
- "zh-cfr",
1181
- "cmn",
1182
- "en-simple",
1183
- "w",
1184
- "wikt",
1185
- "q",
1186
- "b",
1187
- "n",
1188
- "s",
1189
- "chapter",
1190
- "v",
1191
- "voy"
1192
- ],
726
+ "interwiki": [],
1193
727
  "img": {
1194
728
  "thumbnail": "thumbnail",
1195
729
  "thumb": "thumbnail",
@@ -0,0 +1,163 @@
1
+ (() => {
2
+ const version = '1.13.1';
3
+ const workerJS = () => {
4
+ importScripts(`https://testingcf.jsdelivr.net/npm/wikiparser-node@$VERSION-b/bundle/bundle.min.js`);
5
+ const entities = { '&': 'amp', '<': 'lt', '>': 'gt' };
6
+ self.onmessage = ({ data }) => {
7
+ const [command, qid, wikitext, include, stage] = data;
8
+ switch (command) {
9
+ case 'setI18N':
10
+ Parser.i18n = qid;
11
+ break;
12
+ case 'setConfig':
13
+ Parser.config = qid;
14
+ break;
15
+ case 'getConfig':
16
+ postMessage([qid, Parser.getConfig()]);
17
+ break;
18
+ case 'json':
19
+ postMessage([qid, Parser.parse(wikitext, include, stage).json()]);
20
+ break;
21
+ case 'lint':
22
+ postMessage([qid, Parser.parse(wikitext, include).lint(), wikitext]);
23
+ break;
24
+ case 'print':
25
+ postMessage([
26
+ qid,
27
+ Parser.parse(wikitext, include, stage).childNodes.map(child => [
28
+ stage !== null && stage !== void 0 ? stage : Infinity,
29
+ String(child),
30
+ child.type === 'text'
31
+ ? String(child).replace(/[&<>]/gu, p => `&${entities[p]};`)
32
+ : child.print(),
33
+ ]),
34
+ ]);
35
+ }
36
+ };
37
+ };
38
+ const blob = new Blob([`(${String(workerJS).replace('$VERSION', version)})()`], { type: 'text/javascript' }), url = URL.createObjectURL(blob), worker = new Worker(url);
39
+ URL.revokeObjectURL(url);
40
+ const getListener = (qid, resolve, raw) => {
41
+ const listener = ({ data: [rid, res, resRaw] }) => {
42
+ if (rid === qid && (raw === undefined || raw === resRaw)) {
43
+ worker.removeEventListener('message', listener);
44
+ resolve(res);
45
+ }
46
+ };
47
+ return listener;
48
+ };
49
+ const setI18N = (i18n) => {
50
+ worker.postMessage(['setI18N', i18n]);
51
+ };
52
+ const setConfig = (config) => {
53
+ worker.postMessage(['setConfig', config]);
54
+ };
55
+ const getFeedback = (command, qid, strict, raw, ...args) => new Promise(resolve => {
56
+ worker.addEventListener('message', getListener(qid, resolve, strict ? raw : undefined));
57
+ worker.postMessage([command, qid, raw, ...args]);
58
+ });
59
+ const getConfig = () => getFeedback('getConfig', -3);
60
+ const json = (wikitext, include, qid = -4, stage) => getFeedback('json', qid, false, wikitext, include, stage);
61
+ const print = (wikitext, include, stage, qid = -1) => getFeedback('print', qid, false, wikitext, include, stage);
62
+ const lint = (wikitext, include, qid = -2) => getFeedback('lint', qid, true, wikitext, include);
63
+ const append = (parent, text) => {
64
+ if (text) {
65
+ parent.append(text);
66
+ }
67
+ };
68
+ const splitNewLine = (html) => {
69
+ let cur = html.cloneNode();
70
+ cur.style.padding = '';
71
+ const result = [cur];
72
+ for (const child of html.childNodes) {
73
+ const { textContent } = child;
74
+ if (!(textContent === null || textContent === void 0 ? void 0 : textContent.includes('\n'))) {
75
+ cur.append(child.cloneNode(true));
76
+ continue;
77
+ }
78
+ const lines = child.nodeType === Node.TEXT_NODE ? textContent.split('\n') : splitNewLine(child);
79
+ append(cur, lines[0]);
80
+ for (const text of lines.slice(1)) {
81
+ cur = html.cloneNode();
82
+ cur.style.padding = '';
83
+ result.push(cur);
84
+ append(cur, text);
85
+ }
86
+ }
87
+ return result;
88
+ };
89
+ const getGutter = (container) => container.querySelector('.wikiparser-line-numbers');
90
+ const size = (html) => {
91
+ const container = html.parentElement, gutter = getGutter(container);
92
+ if (!gutter) {
93
+ intersectionObserver.unobserve(html);
94
+ return;
95
+ }
96
+ html.style.marginLeft = '';
97
+ const start = Number(html.dataset['start'] || 1), lines = splitNewLine(html), width = `${String(lines.length + start - 1).length + 1.5}ch`;
98
+ html.style.marginLeft = width;
99
+ gutter.style.width = width;
100
+ const sizer = document.createElement('span'), { style: { paddingLeft, paddingRight } } = html;
101
+ sizer.className = 'wikiparser-sizer';
102
+ sizer.style.paddingLeft = paddingLeft;
103
+ sizer.style.paddingRight = paddingRight;
104
+ for (const child of lines) {
105
+ sizer.append(child, '\n');
106
+ }
107
+ html.append(sizer);
108
+ let line, lastTop;
109
+ for (let i = 0; i < lines.length; i++) {
110
+ const child = lines[i], { top } = child.getBoundingClientRect();
111
+ if (line) {
112
+ line.style.height = `${top - lastTop}px`;
113
+ }
114
+ line = document.createElement('span');
115
+ line.textContent = String(i + start);
116
+ gutter.append(line);
117
+ lastTop = top;
118
+ }
119
+ if (line) {
120
+ const noScroll = html.offsetHeight <= container.clientHeight;
121
+ if (html.isContentEditable) {
122
+ line.style.height = `${container.clientHeight}px`;
123
+ }
124
+ else if (noScroll) {
125
+ line.style.height = `${container.getBoundingClientRect().top + container.scrollHeight - lastTop}px`;
126
+ container.style.overflowY = 'hidden';
127
+ }
128
+ else {
129
+ line.style.height = `${html.getBoundingClientRect().bottom - lastTop}px`;
130
+ container.style.overflowY = '';
131
+ }
132
+ }
133
+ sizer.remove();
134
+ intersectionObserver.unobserve(html);
135
+ };
136
+ const intersectionObserver = new IntersectionObserver(entries => {
137
+ for (const entry of entries) {
138
+ if (!entry.isIntersecting) {
139
+ continue;
140
+ }
141
+ size(entry.target);
142
+ }
143
+ });
144
+ const lineNumbers = (html, start = 1, paddingTop = '') => {
145
+ const container = html.parentElement, gutter = document.createElement('span');
146
+ html.dataset['start'] = String(start);
147
+ gutter.className = 'wikiparser-line-numbers';
148
+ gutter.style.paddingTop = paddingTop;
149
+ container.classList.add('wikiparse-container');
150
+ container.append(gutter);
151
+ if (getComputedStyle(html).whiteSpace !== 'pre') {
152
+ html.style.whiteSpace = 'pre-wrap';
153
+ }
154
+ if (html.offsetParent) {
155
+ size(html);
156
+ }
157
+ else {
158
+ intersectionObserver.observe(html);
159
+ }
160
+ };
161
+ const wikiparse = { version, id: 0, setI18N, setConfig, getConfig, print, lint, json, lineNumbers };
162
+ Object.assign(window, { wikiparse });
163
+ })();