@jwilleke/ngdpbase-types 0.0.0 → 5.18.0

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 (302) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +16 -2
  3. package/lib/packages/ngdpbase-types/index.d.ts +32 -0
  4. package/lib/packages/ngdpbase-types/testing.d.ts +43 -0
  5. package/lib/packages/ngdpbase-types/testing.js +53 -0
  6. package/lib/src/cache/CacheDependencies.d.ts +50 -0
  7. package/lib/src/cache/CacheDependencies.js +50 -0
  8. package/lib/src/cache/ICacheAdapter.d.ts +86 -0
  9. package/lib/src/cache/RegionCache.d.ts +171 -0
  10. package/lib/src/context/ActorContext.d.ts +48 -0
  11. package/lib/src/context/ActorContext.js +33 -0
  12. package/lib/src/context/ApiContext.d.ts +194 -0
  13. package/lib/src/context/ApiContext.js +273 -0
  14. package/lib/src/context/BaseContext.d.ts +110 -0
  15. package/lib/src/context/BaseContext.js +143 -0
  16. package/lib/src/context/JobContext.d.ts +153 -0
  17. package/lib/src/context/JobContext.js +144 -0
  18. package/lib/src/context/WikiContext.d.ts +404 -0
  19. package/lib/src/context/bootActions.d.ts +64 -0
  20. package/lib/src/context/bootActions.js +111 -0
  21. package/lib/src/converters/HtmlConverter.d.ts +70 -0
  22. package/lib/src/converters/IContentConverter.d.ts +94 -0
  23. package/lib/src/converters/JSPWikiConverter.d.ts +117 -0
  24. package/lib/src/converters/conversionWarning.d.ts +15 -0
  25. package/lib/src/converters/ncm/bridge.d.ts +22 -0
  26. package/lib/src/converters/ncm/existing.d.ts +23 -0
  27. package/lib/src/converters/ncm/fix/blocks.d.ts +89 -0
  28. package/lib/src/converters/ncm/fix/bulletMarkers.d.ts +21 -0
  29. package/lib/src/converters/ncm/fix/index.d.ts +36 -0
  30. package/lib/src/converters/ncm/fix/jspwikiBullets.d.ts +20 -0
  31. package/lib/src/converters/ncm/fix/jspwikiCodeMarkers.d.ts +38 -0
  32. package/lib/src/converters/ncm/fix/jspwikiHeadings.d.ts +25 -0
  33. package/lib/src/converters/ncm/fix/jspwikiIndent.d.ts +24 -0
  34. package/lib/src/converters/ncm/fix/jspwikiInsert.d.ts +21 -0
  35. package/lib/src/converters/ncm/fix/jspwikiItalic.d.ts +29 -0
  36. package/lib/src/converters/ncm/fix/jspwikiLinkLeftovers.d.ts +27 -0
  37. package/lib/src/converters/ncm/fix/moreInformationFooter.d.ts +25 -0
  38. package/lib/src/converters/ncm/fix/styleClosers.d.ts +25 -0
  39. package/lib/src/converters/ncm/fix/tightenLists.d.ts +30 -0
  40. package/lib/src/converters/ncm/fix/types.d.ts +33 -0
  41. package/lib/src/converters/ncm/footnotes.d.ts +39 -0
  42. package/lib/src/converters/ncm/images.d.ts +49 -0
  43. package/lib/src/converters/ncm/index.d.ts +20 -0
  44. package/lib/src/converters/ncm/links.d.ts +21 -0
  45. package/lib/src/converters/ncm/normalize.d.ts +39 -0
  46. package/lib/src/converters/ncm/placeholder.d.ts +25 -0
  47. package/lib/src/converters/ncm/tables.d.ts +36 -0
  48. package/lib/src/converters/ncm/types.d.ts +42 -0
  49. package/lib/src/http/egressPolicy.d.ts +52 -0
  50. package/lib/src/http/guardedFetch.d.ts +89 -0
  51. package/lib/src/http/guardedFetch.js +113 -0
  52. package/lib/src/http/guardedLookup.d.ts +48 -0
  53. package/lib/src/http/guardedLookup.js +73 -0
  54. package/lib/src/http/ssrf.d.ts +83 -0
  55. package/lib/src/http/ssrf.js +311 -0
  56. package/lib/src/mail/MailProvider.d.ts +36 -0
  57. package/lib/src/mail/NodemailerMailProvider.d.ts +26 -0
  58. package/lib/src/managers/AddonsManager.d.ts +691 -0
  59. package/lib/src/managers/AgentTokenManager.d.ts +269 -0
  60. package/lib/src/managers/AssetManager.d.ts +116 -0
  61. package/lib/src/managers/AttachmentManager.d.ts +1032 -0
  62. package/lib/src/managers/AuthManager.d.ts +1257 -0
  63. package/lib/src/managers/BackgroundJobManager.d.ts +434 -0
  64. package/lib/src/managers/BaseManager.d.ts +391 -0
  65. package/lib/src/managers/BaseManager.js +415 -0
  66. package/lib/src/managers/CacheManager.d.ts +159 -0
  67. package/lib/src/managers/CatalogManager.d.ts +235 -0
  68. package/lib/src/managers/CommentManager.d.ts +75 -0
  69. package/lib/src/managers/ConfigurationManager.d.ts +747 -0
  70. package/lib/src/managers/DatabaseManager.d.ts +89 -0
  71. package/lib/src/managers/DatabaseManager.js +236 -0
  72. package/lib/src/managers/EmailManager.d.ts +47 -0
  73. package/lib/src/managers/ExportManager.d.ts +129 -0
  74. package/lib/src/managers/ExportManager.js +420 -0
  75. package/lib/src/managers/FootnoteManager.d.ts +118 -0
  76. package/lib/src/managers/MediaManager.d.ts +279 -0
  77. package/lib/src/managers/MetricsManager.d.ts +89 -0
  78. package/lib/src/managers/NotificationManager.d.ts +165 -0
  79. package/lib/src/managers/OidcManager.d.ts +210 -0
  80. package/lib/src/managers/OrganizationManager.d.ts +107 -0
  81. package/lib/src/managers/PageManager.d.ts +1645 -0
  82. package/lib/src/managers/PersonManager.d.ts +48 -0
  83. package/lib/src/managers/PluginManager.d.ts +179 -0
  84. package/lib/src/managers/PluginManager.js +393 -0
  85. package/lib/src/managers/PolicyEvaluator.d.ts +213 -0
  86. package/lib/src/managers/RenderingManager.d.ts +358 -0
  87. package/lib/src/managers/RoleManager.d.ts +134 -0
  88. package/lib/src/managers/SearchManager.d.ts +402 -0
  89. package/lib/src/managers/ShareManager.d.ts +251 -0
  90. package/lib/src/managers/TemplateManager.d.ts +176 -0
  91. package/lib/src/managers/ThemeManager.d.ts +56 -0
  92. package/lib/src/managers/UserManager.d.ts +480 -0
  93. package/lib/src/managers/ValidationManager.d.ts +426 -0
  94. package/lib/src/managers/VariableManager.d.ts +145 -0
  95. package/lib/src/middleware/csrf.d.ts +3 -0
  96. package/lib/src/parsers/LinkParser.d.ts +457 -0
  97. package/lib/src/parsers/MarkupParser.d.ts +769 -0
  98. package/lib/src/parsers/context/ParseContext.d.ts +314 -0
  99. package/lib/src/parsers/data/emoji-map.d.ts +18 -0
  100. package/lib/src/parsers/dom/DOMBuilder.d.ts +210 -0
  101. package/lib/src/parsers/dom/DOMParser.d.ts +252 -0
  102. package/lib/src/parsers/dom/Tokenizer.d.ts +358 -0
  103. package/lib/src/parsers/dom/WikiDocument.d.ts +272 -0
  104. package/lib/src/parsers/dom/handlers/DOMLinkHandler.d.ts +260 -0
  105. package/lib/src/parsers/dom/handlers/DOMPluginHandler.d.ts +212 -0
  106. package/lib/src/parsers/dom/handlers/DOMVariableHandler.d.ts +171 -0
  107. package/lib/src/parsers/filters/BaseFilter.d.ts +269 -0
  108. package/lib/src/parsers/filters/FilterChain.d.ts +320 -0
  109. package/lib/src/parsers/handlers/BaseSyntaxHandler.d.ts +331 -0
  110. package/lib/src/parsers/handlers/HandlerRegistry.d.ts +225 -0
  111. package/lib/src/parsers/handlers/JSPWikiPreprocessor.d.ts +89 -0
  112. package/lib/src/parsers/handlers/LinkParserHandler.d.ts +80 -0
  113. package/lib/src/parsers/handlers/PluginSyntaxHandler.d.ts +78 -0
  114. package/lib/src/parsers/handlers/WikiFormHandler.d.ts +149 -0
  115. package/lib/src/parsers/handlers/WikiTagHandler.d.ts +125 -0
  116. package/lib/src/parsers/jspwikiTableRow.d.ts +39 -0
  117. package/lib/src/parsers/styleBlockSyntax.d.ts +14 -0
  118. package/lib/src/plugins/types.d.ts +79 -0
  119. package/lib/src/providers/AgentTokenAuthProvider.d.ts +40 -0
  120. package/lib/src/providers/AuthentikBearerAuthProvider.d.ts +75 -0
  121. package/lib/src/providers/BaseAttachmentProvider.d.ts +197 -0
  122. package/lib/src/providers/BaseAuthProvider.d.ts +220 -0
  123. package/lib/src/providers/BaseCacheProvider.d.ts +140 -0
  124. package/lib/src/providers/BaseCredentialsProvider.d.ts +84 -0
  125. package/lib/src/providers/BaseDatabaseProvider.d.ts +22 -0
  126. package/lib/src/providers/BaseDatabaseProvider.js +12 -0
  127. package/lib/src/providers/BaseLoggingProvider.d.ts +68 -0
  128. package/lib/src/providers/BaseLoggingProvider.js +37 -0
  129. package/lib/src/providers/BaseMediaProvider.d.ts +308 -0
  130. package/lib/src/providers/BasePageProvider.d.ts +337 -0
  131. package/lib/src/providers/BaseProvider.d.ts +98 -0
  132. package/lib/src/providers/BaseProvider.js +74 -0
  133. package/lib/src/providers/BaseSearchProvider.d.ts +362 -0
  134. package/lib/src/providers/BasicAttachmentProvider.d.ts +599 -0
  135. package/lib/src/providers/CloudflareAccessAuthProvider.d.ts +72 -0
  136. package/lib/src/providers/FileCredentialsProvider.d.ts +33 -0
  137. package/lib/src/providers/FileJobStateProvider.d.ts +58 -0
  138. package/lib/src/providers/FileLoggingProvider.d.ts +43 -0
  139. package/lib/src/providers/FileLoggingProvider.js +120 -0
  140. package/lib/src/providers/FileOidcAdapter.d.ts +25 -0
  141. package/lib/src/providers/FileSystemMediaProvider.d.ts +403 -0
  142. package/lib/src/providers/LunrSearchProvider.d.ts +280 -0
  143. package/lib/src/providers/MagicLinkAuthProvider.d.ts +125 -0
  144. package/lib/src/providers/NullCacheProvider.d.ts +72 -0
  145. package/lib/src/providers/OidcAuthProvider.d.ts +180 -0
  146. package/lib/src/providers/OidcBearerAuthProvider.d.ts +30 -0
  147. package/lib/src/providers/PasskeyAuthProvider.d.ts +58 -0
  148. package/lib/src/providers/PasswordAuthProvider.d.ts +20 -0
  149. package/lib/src/providers/SqliteDatabaseProvider.d.ts +55 -0
  150. package/lib/src/providers/SqliteDatabaseProvider.js +90 -0
  151. package/lib/src/providers/SqliteJobStateProvider.d.ts +41 -0
  152. package/lib/src/providers/databaseMigrations.d.ts +8 -0
  153. package/lib/src/providers/databaseMigrations.js +47 -0
  154. package/lib/src/providers/jobState.d.ts +99 -0
  155. package/lib/src/providers/lunrQueryToMiniSearch.d.ts +32 -0
  156. package/lib/src/providers/mediaFilenameDate.d.ts +22 -0
  157. package/lib/src/providers/sqliteLocation.d.ts +17 -0
  158. package/lib/src/providers/sqliteLocation.js +55 -0
  159. package/lib/src/providers/sqliteMigrations.d.ts +48 -0
  160. package/lib/src/providers/sqliteMigrations.js +72 -0
  161. package/lib/src/rendering/githubAlerts.d.ts +22 -0
  162. package/lib/src/rendering/htmlPolicy.d.ts +76 -0
  163. package/lib/src/rendering/markdownConverter.d.ts +73 -0
  164. package/lib/src/security/PolicyDecisionPoint.d.ts +245 -0
  165. package/lib/src/security/PolicyInformationPoint.d.ts +448 -0
  166. package/lib/src/security/pageActions.d.ts +40 -0
  167. package/lib/src/security/permissions.generated.d.ts +78 -0
  168. package/lib/src/types/Asset.d.ts +414 -0
  169. package/lib/src/types/Catalog.d.ts +61 -0
  170. package/lib/src/types/Comment.d.ts +11 -0
  171. package/lib/src/types/Config.d.ts +388 -0
  172. package/lib/src/types/Organization.d.ts +78 -0
  173. package/lib/src/types/OrganizationProvider.d.ts +38 -0
  174. package/lib/src/types/Page.d.ts +220 -0
  175. package/lib/src/types/Person.d.ts +56 -0
  176. package/lib/src/types/PersonProvider.d.ts +25 -0
  177. package/lib/src/types/Policy.d.ts +139 -0
  178. package/lib/src/types/Policy.js +17 -0
  179. package/lib/src/types/Provider.d.ts +810 -0
  180. package/lib/src/types/Role.d.ts +84 -0
  181. package/lib/src/types/RoleProvider.d.ts +35 -0
  182. package/lib/src/types/Schema.d.ts +425 -0
  183. package/lib/src/types/Share.d.ts +172 -0
  184. package/lib/src/types/Share.js +81 -0
  185. package/lib/src/types/User.d.ts +304 -0
  186. package/lib/src/types/Version.d.ts +189 -0
  187. package/lib/src/types/WikiEngine.d.ts +128 -0
  188. package/lib/src/types/express.d.ts +120 -0
  189. package/lib/src/types/express.js +1 -0
  190. package/lib/src/types/guards.d.ts +78 -0
  191. package/lib/src/types/heic-decode.d.ts +16 -0
  192. package/lib/src/types/index.d.ts +19 -0
  193. package/lib/src/types/linkedom.d.ts +77 -0
  194. package/lib/src/types/markdown-it-plugins.d.ts +21 -0
  195. package/lib/src/utils/DeltaStorage.d.ts +118 -0
  196. package/lib/src/utils/LocaleUtils.d.ts +105 -0
  197. package/lib/src/utils/LocaleUtils.js +294 -0
  198. package/lib/src/utils/PageNameMatcher.d.ts +98 -0
  199. package/lib/src/utils/PathPreflight.d.ts +38 -0
  200. package/lib/src/utils/PathPreflight.js +50 -0
  201. package/lib/src/utils/SectionUtils.d.ts +40 -0
  202. package/lib/src/utils/addonConfigLayer.d.ts +144 -0
  203. package/lib/src/utils/addonConfigLayer.js +382 -0
  204. package/lib/src/utils/addonDatabaseRules.d.ts +25 -0
  205. package/lib/src/utils/addonDatabaseRules.js +57 -0
  206. package/lib/src/utils/addonHost.d.ts +51 -0
  207. package/lib/src/utils/addonHost.js +72 -0
  208. package/lib/src/utils/addonInstaller.d.ts +109 -0
  209. package/lib/src/utils/addonLock.d.ts +37 -0
  210. package/lib/src/utils/addonLock.js +48 -0
  211. package/lib/src/utils/addonPageSync.d.ts +45 -0
  212. package/lib/src/utils/addonProvenance.d.ts +48 -0
  213. package/lib/src/utils/addonTarball.d.ts +41 -0
  214. package/lib/src/utils/addonsPathResolver.d.ts +76 -0
  215. package/lib/src/utils/addonsPathResolver.js +129 -0
  216. package/lib/src/utils/assetMetadataTags.d.ts +66 -0
  217. package/lib/src/utils/atomicWrite.d.ts +28 -0
  218. package/lib/src/utils/auditConfigChange.d.ts +57 -0
  219. package/lib/src/utils/auditEventNames.d.ts +50 -0
  220. package/lib/src/utils/auditEventNames.generated.d.ts +163 -0
  221. package/lib/src/utils/auditEventNames.generated.js +168 -0
  222. package/lib/src/utils/auditEventNames.js +49 -0
  223. package/lib/src/utils/auditEvents.d.ts +265 -0
  224. package/lib/src/utils/auditEvents.js +309 -0
  225. package/lib/src/utils/auditRegistry.d.ts +102 -0
  226. package/lib/src/utils/auditRegistry.js +168 -0
  227. package/lib/src/utils/bip39English.d.ts +2 -0
  228. package/lib/src/utils/configEnvKeys.d.ts +68 -0
  229. package/lib/src/utils/configFiles.d.ts +74 -0
  230. package/lib/src/utils/configFiles.js +150 -0
  231. package/lib/src/utils/delegation.d.ts +48 -0
  232. package/lib/src/utils/deriveUsername.d.ts +21 -0
  233. package/lib/src/utils/explainMediaPath.d.ts +123 -0
  234. package/lib/src/utils/formerTitles.d.ts +69 -0
  235. package/lib/src/utils/frontmatterAccess.d.ts +54 -0
  236. package/lib/src/utils/headlessAdminPassword.d.ts +55 -0
  237. package/lib/src/utils/imageTransform.d.ts +52 -0
  238. package/lib/src/utils/instanceEnvSecret.d.ts +51 -0
  239. package/lib/src/utils/jobSlots.d.ts +43 -0
  240. package/lib/src/utils/keywordNormalizer.d.ts +127 -0
  241. package/lib/src/utils/logger.d.ts +70 -0
  242. package/lib/src/utils/logger.js +106 -0
  243. package/lib/src/utils/magicLinkDeviceState.d.ts +95 -0
  244. package/lib/src/utils/managerUtils.d.ts +40 -0
  245. package/lib/src/utils/migrateLegacyPrivateAttachments.d.ts +15 -0
  246. package/lib/src/utils/orgFilename.d.ts +22 -0
  247. package/lib/src/utils/pageFeature.d.ts +27 -0
  248. package/lib/src/utils/pageFrontmatter.d.ts +21 -0
  249. package/lib/src/utils/pageNotes.d.ts +150 -0
  250. package/lib/src/utils/pageTitleRule.d.ts +37 -0
  251. package/lib/src/utils/pageToArticle.d.ts +59 -0
  252. package/lib/src/utils/pageUrl.d.ts +18 -0
  253. package/lib/src/utils/passwordChange.d.ts +12 -0
  254. package/lib/src/utils/passwordHash.d.ts +60 -0
  255. package/lib/src/utils/permissionCatalog.d.ts +52 -0
  256. package/lib/src/utils/pluginFormatters.d.ts +452 -0
  257. package/lib/src/utils/pluginFormatters.js +714 -0
  258. package/lib/src/utils/privateLinkRewrite.d.ts +42 -0
  259. package/lib/src/utils/privateStoreAccess.d.ts +57 -0
  260. package/lib/src/utils/privateStoreAccess.js +65 -0
  261. package/lib/src/utils/privateStoreCatalogs.d.ts +40 -0
  262. package/lib/src/utils/privateStoreCrypto.d.ts +127 -0
  263. package/lib/src/utils/privateStoreDoor.d.ts +181 -0
  264. package/lib/src/utils/privateStoreExport.d.ts +72 -0
  265. package/lib/src/utils/privateStoreFiles.d.ts +120 -0
  266. package/lib/src/utils/privateStoreMeta.d.ts +64 -0
  267. package/lib/src/utils/privateStoreMigrations.d.ts +37 -0
  268. package/lib/src/utils/privateStorePath.d.ts +259 -0
  269. package/lib/src/utils/privateStorePath.js +436 -0
  270. package/lib/src/utils/privateStoreTakeout.d.ts +76 -0
  271. package/lib/src/utils/privateStoreUnlock.d.ts +175 -0
  272. package/lib/src/utils/proxyClaim.d.ts +59 -0
  273. package/lib/src/utils/proxyClaim.js +30 -0
  274. package/lib/src/utils/redactPrivateNames.d.ts +21 -0
  275. package/lib/src/utils/redactPrivateNames.js +89 -0
  276. package/lib/src/utils/redactSecrets.d.ts +58 -0
  277. package/lib/src/utils/redactSecrets.js +171 -0
  278. package/lib/src/utils/renameLinkRewrite.d.ts +112 -0
  279. package/lib/src/utils/roleGrants.d.ts +35 -0
  280. package/lib/src/utils/safeRedirect.d.ts +32 -0
  281. package/lib/src/utils/schedule.d.ts +54 -0
  282. package/lib/src/utils/secretFileMode.d.ts +17 -0
  283. package/lib/src/utils/seededShippedPages.d.ts +45 -0
  284. package/lib/src/utils/sensitiveValues.d.ts +59 -0
  285. package/lib/src/utils/sensitiveValues.js +106 -0
  286. package/lib/src/utils/sessionEnd.d.ts +12 -0
  287. package/lib/src/utils/sessionGeneration.d.ts +24 -0
  288. package/lib/src/utils/sessionIdle.d.ts +41 -0
  289. package/lib/src/utils/sessionLimits.d.ts +68 -0
  290. package/lib/src/utils/shareLockbox.d.ts +64 -0
  291. package/lib/src/utils/sigstoreTrustedRoot.d.ts +33 -0
  292. package/lib/src/utils/sniffMime.d.ts +21 -0
  293. package/lib/src/utils/storeSearchIndex.d.ts +75 -0
  294. package/lib/src/utils/subjectMayDo.d.ts +21 -0
  295. package/lib/src/utils/systemCategoryRules.d.ts +30 -0
  296. package/lib/src/utils/systemCategoryRules.js +41 -0
  297. package/lib/src/utils/userCreateError.d.ts +62 -0
  298. package/lib/src/utils/username.d.ts +53 -0
  299. package/lib/src/utils/vaultUrlRewrite.d.ts +27 -0
  300. package/lib/src/utils/version.d.ts +84 -0
  301. package/lib/src/utils/videoFrame.d.ts +21 -0
  302. package/package.json +54 -3
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Content Converter Interface
3
+ *
4
+ * Defines the contract that all content converters must implement.
5
+ * This allows importing content from various wiki formats (JSPWiki, MediaWiki, etc.)
6
+ * and converting them to Markdown format for ngdpbase.
7
+ *
8
+ * @module IContentConverter
9
+ *
10
+ * @example
11
+ * class MyWikiConverter implements IContentConverter {
12
+ * readonly formatId = 'mywiki';
13
+ * readonly formatName = 'MyWiki';
14
+ * readonly fileExtensions = ['.mw'];
15
+ *
16
+ * convert(content: string): ConversionResult {
17
+ * // Convert content to Markdown
18
+ * return { content: convertedMarkdown, metadata: {}, warnings: [] };
19
+ * }
20
+ *
21
+ * canHandle(content: string, filename: string): boolean {
22
+ * return filename.endsWith('.mw') || content.includes('{{MyWikiSyntax}}');
23
+ * }
24
+ * }
25
+ */
26
+ /**
27
+ * A structured conversion warning (#728 S3). `kind` is a stable, aggregatable
28
+ * code (the prerequisite for the #738 conversion-metrics work); `detail` is
29
+ * the human-readable specifics. `kind` is `string` (not an enum) because
30
+ * converters and NCM each contribute their own codes — `NcmWarning` is an
31
+ * assignable subset.
32
+ */
33
+ export interface ConversionWarning {
34
+ kind: string;
35
+ detail: string;
36
+ }
37
+ /**
38
+ * Result of a content conversion operation
39
+ */
40
+ export interface ConversionResult {
41
+ /** The converted Markdown content */
42
+ content: string;
43
+ /** Extracted metadata (e.g., from JSPWiki [{SET name=value}] attributes) */
44
+ metadata: Record<string, unknown>;
45
+ /** Structured warnings generated during conversion (non-fatal issues). */
46
+ warnings: ConversionWarning[];
47
+ }
48
+ /**
49
+ * Content converter interface
50
+ * All format converters must implement these methods
51
+ */
52
+ export interface IContentConverter {
53
+ /**
54
+ * Unique identifier for this converter format
55
+ * Used for format selection in import options (e.g., 'jspwiki', 'mediawiki')
56
+ */
57
+ readonly formatId: string;
58
+ /**
59
+ * Human-readable name for this format
60
+ * Displayed in UI format selection (e.g., 'JSPWiki', 'MediaWiki')
61
+ */
62
+ readonly formatName: string;
63
+ /**
64
+ * File extensions this converter handles
65
+ * Used for auto-detection (e.g., ['.txt', '.wiki'])
66
+ */
67
+ readonly fileExtensions: string[];
68
+ /**
69
+ * Convert content from source format to Markdown
70
+ *
71
+ * @param content - The source content to convert
72
+ * @returns Conversion result with Markdown content, metadata, and warnings
73
+ */
74
+ convert(content: string): ConversionResult;
75
+ /**
76
+ * Check if this converter can handle the given content
77
+ * Used for format auto-detection when multiple converters exist
78
+ *
79
+ * @param content - The file content to check
80
+ * @param filename - The filename (for extension checking)
81
+ * @returns True if this converter can handle the content
82
+ */
83
+ canHandle(content: string, filename: string): boolean;
84
+ /**
85
+ * #1131: convert a BINARY source (e.g. .docx) — optional; its presence
86
+ * tells ImportManager to read the file as a Buffer instead of UTF-8 and
87
+ * call this instead of {@link convert}. The result's `content` may be an
88
+ * intermediate format (DocxConverter returns HTML) that ImportManager
89
+ * routes through the NCM normalizer like any other registered source.
90
+ * Async because binary converters (mammoth) are.
91
+ */
92
+ convertBuffer?(buffer: Buffer): Promise<ConversionResult>;
93
+ }
94
+ export default IContentConverter;
@@ -0,0 +1,117 @@
1
+ /**
2
+ * JSPWiki to Markdown Converter
3
+ *
4
+ * Converts JSPWiki syntax to Markdown format for import into ngdpbase.
5
+ * Implements IContentConverter interface for use with ImportManager.
6
+ *
7
+ * Reference: https://github.com/apache/jspwiki/blob/main/jspwiki-wikipages/en/src/main/resources/TextFormattingRules.txt
8
+ *
9
+ * @module JSPWikiConverter
10
+ */
11
+ import { IContentConverter, ConversionResult } from './IContentConverter.js';
12
+ /**
13
+ * JSPWiki syntax to Markdown converter
14
+ */
15
+ declare class JSPWikiConverter implements IContentConverter {
16
+ readonly formatId = "jspwiki";
17
+ readonly formatName = "JSPWiki";
18
+ readonly fileExtensions: string[];
19
+ /**
20
+ * Convert JSPWiki content to Markdown
21
+ *
22
+ * @param content - JSPWiki formatted content
23
+ * @returns ConversionResult with Markdown content, metadata, and warnings
24
+ */
25
+ convert(content: string): ConversionResult;
26
+ /**
27
+ * Check if this converter can handle the given content
28
+ * Uses filename extension and content pattern detection
29
+ */
30
+ canHandle(content: string, filename: string): boolean;
31
+ /**
32
+ * Extract [{SET name=value}] attributes and convert to metadata
33
+ */
34
+ private extractAttributes;
35
+ /**
36
+ * Extract %%category [Name]%% blocks and convert to user-keywords
37
+ *
38
+ * JSPWiki uses category blocks for page categorization:
39
+ * %%category [CategoryName]%% - single line, %% closing
40
+ * %%category [CategoryName] /% - may span lines, /% closing
41
+ *
42
+ * These are converted to ngdpbase's user-keywords metadata array.
43
+ */
44
+ private extractCategories;
45
+ /**
46
+ * Convert JSPWiki headings to Markdown
47
+ * !!! -> # (h1), !! -> ## (h2), ! -> ### (h3)
48
+ */
49
+ private convertHeadings;
50
+ /**
51
+ * Convert JSPWiki emphasis to Markdown
52
+ * __bold__ -> **bold**
53
+ * ''italic'' -> *italic*
54
+ */
55
+ private convertEmphasis;
56
+ /**
57
+ * JSPWiki monospace `{{text}}` → an inline code span (#1342).
58
+ *
59
+ * Here only, never in the NCM funnel: in Markdown from anywhere else
60
+ * `{{name}}` is template syntax, and converting it would strip the braces
61
+ * (operator decision, 2026-09-26). The match is balanced, so braces inside
62
+ * (`{{.mark {background:yellow;}}}`) stay in the span; inside it the
63
+ * JSPWiki escapes `[[`, `&#91;` and `&#124;` read as the reader saw them.
64
+ * In a table row a span that would hold a `|` is left as written, since
65
+ * the bar would split the cell. Code, and `{{{ }}}` blocks, are left alone.
66
+ */
67
+ private convertMonospace;
68
+ private monospaceLine;
69
+ /** Where the `}}` closing a monospace run starts, counting nested braces; -1 if none. */
70
+ private monospaceEnd;
71
+ /**
72
+ * Convert JSPWiki code blocks to Markdown
73
+ * {{{ code }}} -> ``` code ```
74
+ */
75
+ private convertCodeBlocks;
76
+ /**
77
+ * Convert JSPWiki lists to Markdown
78
+ * * item -> - item (unordered)
79
+ * ** nested -> - - nested (indented unordered)
80
+ * # item -> 1. item (ordered)
81
+ * ## nested -> 1. 1. nested (indented ordered)
82
+ */
83
+ private convertLists;
84
+ /**
85
+ * Convert JSPWiki definition lists to Markdown
86
+ * ;term:definition -> **term**: definition
87
+ */
88
+ private convertDefinitionLists;
89
+ /**
90
+ * Convert JSPWiki horizontal rules to Markdown
91
+ * ---- (or more dashes) -> ---
92
+ */
93
+ private convertHorizontalRules;
94
+ /**
95
+ * Convert JSPWiki links to Markdown/WikiLink format
96
+ * [link] -> [[link]]
97
+ * [display text|link] -> [[link|display text]]
98
+ */
99
+ private convertLinks;
100
+ /**
101
+ * Convert JSPWiki footnotes to Markdown footnotes
102
+ * [1] -> [^1]
103
+ * [#1] footnote text -> [^1]: footnote text
104
+ */
105
+ private convertFootnotes;
106
+ /**
107
+ * Strip page paths from Image plugin src attributes
108
+ *
109
+ * JSPWiki uses page-level attachments, so image paths include the page name:
110
+ * [{Image src='Geological Timeline/Geolog_path_text.svg.png' ...}]
111
+ *
112
+ * ngdpbase uses a flat attachment structure, so we strip the path:
113
+ * [{Image src='Geolog_path_text.svg.png' ...}]
114
+ */
115
+ private convertImagePaths;
116
+ }
117
+ export default JSPWikiConverter;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Classify legacy free-text converter warnings into structured
3
+ * {@link ConversionWarning} (#728 S3).
4
+ *
5
+ * The 3 converters build their warnings as prose `string[]` internally; this
6
+ * maps them to a stable `kind` at the single `convert()` return site, so the
7
+ * ~12 push call-sites don't each need touching. `detail` preserves the
8
+ * original message verbatim (lossless). `kind` is coarse but stable and
9
+ * aggregatable — finer taxonomy can come later without breaking the contract.
10
+ *
11
+ * @module converters/conversionWarning
12
+ */
13
+ import type { ConversionWarning } from './IContentConverter.js';
14
+ /** Map a prose `string[]` to structured `ConversionWarning[]`. */
15
+ export declare function classifyWarnings(messages: string[]): ConversionWarning[];
@@ -0,0 +1,22 @@
1
+ /**
2
+ * NCM → ConversionResult bridge (#728 Phase 2 Slice 5b)
3
+ *
4
+ * Adapts an `NcmResult` to the shared `ConversionResult` shape so the import
5
+ * path can route through `normalizeToNcm`. Since #728 S3 made
6
+ * `ConversionResult.warnings` structured (`ConversionWarning {kind,detail}`),
7
+ * this bridge is now **lossless** — `NcmWarning` is an assignable subset:
8
+ *
9
+ * - the NCM document's frontmatter → `metadata`
10
+ * - the NCM body → `content`
11
+ * - `NcmWarning[]` → `warnings` (structured, unchanged)
12
+ *
13
+ * @module converters/ncm/bridge
14
+ */
15
+ import type { ConversionResult } from '../IContentConverter.js';
16
+ import type { NcmResult } from './types.js';
17
+ /**
18
+ * Adapt an {@link NcmResult} to the legacy {@link ConversionResult} shape.
19
+ * Frontmatter (including the stamped `ncmVersion`) is split into `metadata`
20
+ * so existing ImportManager/MCP pipelines consume it unchanged.
21
+ */
22
+ export declare function ncmToConversionResult(ncm: NcmResult): ConversionResult;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Convert an existing page to NCM (#728 Phase 2 Slice 5a)
3
+ *
4
+ * "Convert existing page" is distinct from importing a Markdown file (which
5
+ * stays on `MarkdownConverter`). An existing wiki page is loose Markdown that
6
+ * should become NCM — so unlike the S1 `'markdown'` fixed point (which only
7
+ * stamps/sorts), this also applies the §2.4 link normalization to the body,
8
+ * then runs the S1 fixed point so determinism / `ncmVersion` stay
9
+ * single-sourced. Idempotent: a page already in NCM round-trips byte-identical.
10
+ *
11
+ * Image localization is intentionally NOT done here — it needs real
12
+ * fetch/AttachmentManager wiring and is the immediate follow-up micro-slice
13
+ * (S5a-ii). Embedded images survive as Markdown image syntax until then.
14
+ *
15
+ * @module converters/ncm/existing
16
+ */
17
+ import type { NcmResult } from './types.js';
18
+ /**
19
+ * Normalize an existing page's raw content (frontmatter + body) to NCM.
20
+ *
21
+ * @param raw Full stored page content (YAML frontmatter + Markdown body)
22
+ */
23
+ export declare function normalizeExistingPageToNcm(raw: string): NcmResult;
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Block map of a page body, read from markdown-it's parser (#1332).
3
+ *
4
+ * Every fix step asks the same questions of a page — is this line code? is it
5
+ * inside an HTML block? which lines start a list item, of which list, at what
6
+ * depth? — and each used to answer them with its own line regexes. Those
7
+ * regexes were approximations of CommonMark, and each approximation was wrong
8
+ * in its own way (#1335, the no-break-space `*`, the lazy line that ended a
9
+ * list early). This module answers them once, from the parser that will
10
+ * render the page after the converter swap (#1273), using the source line
11
+ * range markdown-it records on every block token.
12
+ *
13
+ * Code lines are the union of what markdown-it calls code (fences, indented
14
+ * code) and what MarkupParser's Step 0 extracts as a fenced block before any
15
+ * converter runs (#1335: an optionally indented run of three or more
16
+ * backticks, closed by the same run indented no further than the opener or
17
+ * 3 spaces). A step never edits a line either of them treats as code.
18
+ *
19
+ * Lines are split on `\n`; a trailing `\r` is kept out of the text the steps
20
+ * see and put back by {@link joinLines}, so CRLF pages stay CRLF.
21
+ *
22
+ * @module converters/ncm/fix/blocks
23
+ */
24
+ /** A direct child block of a list item. */
25
+ export interface ItemBlock {
26
+ /** Token type of the block's opening token (`paragraph_open`, `fence`, `bullet_list_open`, ...). */
27
+ type: string;
28
+ /** First line (0-based). */
29
+ start: number;
30
+ /** Line after the last (0-based, exclusive). */
31
+ end: number;
32
+ }
33
+ export interface ListItem {
34
+ /** Line the item's marker is on (0-based). */
35
+ line: number;
36
+ /** Line after the item's last line (0-based, exclusive). May include trailing empty lines. */
37
+ end: number;
38
+ /** The marker character: `-`, `*`, `+`, `.` or `)`. */
39
+ markup: string;
40
+ /** Nesting depth: 0 for an item of a top-level list. */
41
+ depth: number;
42
+ /** Position among the list items that start on the same line, outermost first (`- * a` has two). */
43
+ orderOnLine: number;
44
+ /** Direct child blocks, in order. */
45
+ blocks: ItemBlock[];
46
+ list: ListInfo;
47
+ }
48
+ export interface ListInfo {
49
+ ordered: boolean;
50
+ /** First line (0-based). */
51
+ start: number;
52
+ /** Line after the last (0-based, exclusive). */
53
+ end: number;
54
+ /** CommonMark tight list: no empty line between its items or their blocks. */
55
+ tight: boolean;
56
+ depth: number;
57
+ items: ListItem[];
58
+ /** The outermost list this one sits in (itself when top-level). */
59
+ outer: ListInfo;
60
+ }
61
+ export interface BlockMap {
62
+ /** Page lines without their `\r`. */
63
+ lines: string[];
64
+ /** `\r` where the line had one, else ''. */
65
+ eols: string[];
66
+ /** true for a line inside fenced or indented code (markdown-it or Step 0). */
67
+ code: boolean[];
68
+ /** true for a line inside an HTML block. */
69
+ html: boolean[];
70
+ /** Every list, outer lists before the lists nested in them. */
71
+ lists: ListInfo[];
72
+ /** Every list item, in source order. */
73
+ items: ListItem[];
74
+ /** The paragraph blocks' line ranges, in source order. */
75
+ paragraphs: ItemBlock[];
76
+ }
77
+ export declare function splitLines(body: string): {
78
+ lines: string[];
79
+ eols: string[];
80
+ };
81
+ export declare function joinLines(lines: string[], eols: string[]): string;
82
+ export declare function isBlank(line: string): boolean;
83
+ export declare function buildBlockMap(body: string): BlockMap;
84
+ /**
85
+ * Column of each list marker at the start of a line, outermost first:
86
+ * `> - * a` gives the columns of `-` and `*`. Block-quote `>` markers are
87
+ * skipped, not returned. Pair the result with {@link ListItem.orderOnLine}.
88
+ */
89
+ export declare function markerColumns(line: string): number[];
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Bullet markers → the house style, `- ` (#1271 decision S1).
3
+ *
4
+ * CommonMark accepts `*`, `+` and `-` as bullet markers, and starts a NEW list
5
+ * whenever the marker changes. Imported JSPWiki pages use `* item`; pages
6
+ * written here use `- item`; mixing them on one page reads inconsistently in
7
+ * the source and splits lists that were meant to be one. This rewrites every
8
+ * bullet marker the parser sees to `-`, keeping its indent and spacing, so
9
+ * nothing moves.
10
+ *
11
+ * Because the parser decides what is a list item, a thematic break (`* * *`),
12
+ * emphasis (`*italic*`), indented code and fenced code are never touched, and
13
+ * a bullet inside a block quote (`> * item`) is. The result is parsed again:
14
+ * a new marker merges lists that differed only by marker, but must never add,
15
+ * drop or re-nest an item (`* - -` would become a thematic break), and if it
16
+ * does, nothing is changed.
17
+ *
18
+ * @module converters/ncm/fix/bulletMarkers
19
+ */
20
+ import type { FixStep } from './types.js';
21
+ export declare const bulletMarkers: FixStep;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Markdown fix module (#1332): every conversion of page text in one place.
3
+ *
4
+ * Each step is small, pure and idempotent, reads the page through the
5
+ * markdown-it block map ({@link buildBlockMap}) and edits only the source lines
6
+ * it must. Steps run in registry order, each on the previous step's output.
7
+ *
8
+ * In the app only managers call this — PageManager through
9
+ * `normalizePageContent` — so Convert to NCM, ingest and import all apply the
10
+ * same rules. An ordinary save never runs them. The offline migration (scripts/fix-page-markdown.ts)
11
+ * calls {@link runFixes} directly: the same steps, without booting the engine
12
+ * for a dry run. It works on the page body; frontmatter is the caller's.
13
+ *
14
+ * @module converters/ncm/fix
15
+ */
16
+ import type { FixResult, FixStep } from './types.js';
17
+ export type { FixResult, FixStep, FixChange, FixStepResult } from './types.js';
18
+ export { buildBlockMap } from './blocks.js';
19
+ export type { BlockMap, ListInfo, ListItem, ItemBlock } from './blocks.js';
20
+ /**
21
+ * Every step, in the order they run. Order matters: `{{{ }}}` blocks become
22
+ * code first, so the steps after never edit the examples inside them (a
23
+ * `%%` in an example stays as written); `!` headings become `#` before the
24
+ * footer step looks for a "More Information" heading; `**`
25
+ * bullets become list items before the marker and spacing steps look at the
26
+ * lists.
27
+ */
28
+ export declare const FIX_STEPS: readonly FixStep[];
29
+ export interface RunFixesOptions {
30
+ /** Run exactly these step ids, in registry order. Default: every step. */
31
+ steps?: readonly string[];
32
+ }
33
+ /** The steps an id list selects (default every step), in registry order. */
34
+ export declare function selectFixSteps(options?: RunFixesOptions): FixStep[];
35
+ /** Run the selected steps over a page body. */
36
+ export declare function runFixes(body: string, options?: RunFixesOptions): FixResult;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * JSPWiki nested bullets → Markdown nested bullets (#1325).
3
+ *
4
+ * JSPWiki writes a second-level bullet as `** item` and a third as `*** item`.
5
+ * That is not Markdown: CommonMark reads `** item` as a paragraph starting
6
+ * with two asterisks, so imported pages show literal stars. Each is rewritten
7
+ * to a hyphen bullet indented 2 spaces per level below the first — the house
8
+ * style — so `** item` becomes ` - item` and sits under the `* parent` above it.
9
+ *
10
+ * Deliberately narrow:
11
+ * - only lines that START with two or more `*` followed by whitespace;
12
+ * `**bold** text` has no space after the stars and is left alone;
13
+ * - single-star `* item` is a valid CommonMark bullet (the bullet-markers
14
+ * step's business, not this one's);
15
+ * - never a line the renderer treats as code or HTML.
16
+ *
17
+ * @module converters/ncm/fix/jspwikiBullets
18
+ */
19
+ import type { FixStep } from './types.js';
20
+ export declare const jspwikiBullets: FixStep;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * JSPWiki `{{{ }}}` code markers → Markdown code (#1332).
3
+ *
4
+ * JSPWiki marks preformatted text with `{{{` and `}}}`. That is not Markdown:
5
+ * the renderer shows the braces and reads the text inside as page markup, so
6
+ * `** item` in an example becomes a bullet and `[{Plugin}]` runs. Rewritten:
7
+ *
8
+ * - a `{{{` at the start of a line (up to 3 spaces in) opens a block, closed
9
+ * by the first `}}}` after it — or by a ``` line, where an author mixed
10
+ * the two. Both become ``` fences at the opener's indent; text after the
11
+ * `{{{`, and text before or after the `}}}` (`}}} /%`), moves onto a line
12
+ * of its own. Lines in between are code and are not changed;
13
+ * - `{{{text}}}` on one line becomes an inline code span. A `[[{` inside
14
+ * becomes `[{`: outside code that escape shows as `[{`, which is what the
15
+ * reader saw between the braces, but inside a code span it would show;
16
+ * - a ``` block opened right under a `%%` style line (`%%prettify`) and
17
+ * ended by `}}}` with `/%` after it, on the same line or the next, is
18
+ * closed there: `}}}` becomes ``` and the `/%` goes on its own line. An
19
+ * old import turned the lone `{{{` into ``` but left `}}} /%`, so the
20
+ * code ran on through the rest of the page.
21
+ *
22
+ * Deliberately narrow:
23
+ * - never a `{{{` inside code, an inline code span or an HTML block;
24
+ * - a `}}}` with no `{{{` before it is left alone (`{\boldsymbol {\tau }}}`);
25
+ * - a `{{{` that opens mid-line and closes on a later line is left alone:
26
+ * it is inline text across a line break, and a fence there would split
27
+ * the sentence (or list item) it sits in;
28
+ * - any other `}}}` inside a ``` block is code, and is left alone;
29
+ * - if any `{{{` block is never closed, nothing is changed.
30
+ *
31
+ * Runs first, so the steps after it see the example text as code.
32
+ *
33
+ * @module converters/ncm/fix/jspwikiCodeMarkers
34
+ */
35
+ import type { FixStep } from './types.js';
36
+ /** An inline code span holding `code`, with a backtick run longer than any inside it. */
37
+ export declare function codeSpan(code: string): string;
38
+ export declare const jspwikiCodeMarkers: FixStep;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * JSPWiki `!` headings → Markdown ATX headings (#1342).
3
+ *
4
+ * JSPWiki marks a heading with `!` at the start of a line, and more marks
5
+ * mean a LARGER heading: `!!!` is the largest, `!` the smallest. So `!!!`
6
+ * becomes `#`, `!!` becomes `##` and `!` becomes `###`. Markdown shows a `!`
7
+ * line as literal text.
8
+ *
9
+ * The one place this mapping lives: the JSPWiki file converter calls this
10
+ * step too, so a JSPWiki import and the NCM funnel read a `!` line the same
11
+ * way.
12
+ *
13
+ * Deliberately narrow:
14
+ * - the `!` must be the first character of the line, as in JSPWiki;
15
+ * - a Markdown image, `![alt](src)`, is not a heading; `![Main]` (a
16
+ * heading whose text starts with a link) still is;
17
+ * - a line with nothing after the marks is left alone;
18
+ * - never a line the renderer treats as code or HTML.
19
+ *
20
+ * @module converters/ncm/fix/jspwikiHeadings
21
+ */
22
+ import type { FixStep } from './types.js';
23
+ /** The ATX heading for a JSPWiki `!` line, or null when the line is not one. */
24
+ export declare function jspwikiHeadingLine(line: string): string | null;
25
+ export declare const jspwikiHeadings: FixStep;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * JSPWiki `;:text` → a plain paragraph (#1342).
3
+ *
4
+ * `;term:definition` is a JSPWiki definition list; with the term left empty,
5
+ * `;:text`, it is the indentation idiom — a continuation line, not a term,
6
+ * a quotation or a list. Markdown shows the `;:` as text. The marker goes and
7
+ * the text stands as its own paragraph (operator decision, 2026-09-26): a
8
+ * blockquote or a bullet would invent structure the author did not write.
9
+ *
10
+ * `;:` is never Markdown, so this runs on every NCM path. A definition with a
11
+ * term (`;term:def`) is not this step's: the JSPWiki converter maps it.
12
+ *
13
+ * Deliberately narrow:
14
+ * - only a line that starts with `;:`;
15
+ * - the text keeps what follows the marker (`**img** = …`, `*Comment*`);
16
+ * - a converted line gets a blank line on each side, so consecutive ones
17
+ * stay separate paragraphs, as the JSPWiki lines were separate;
18
+ * - a `;:` with nothing after it is dropped;
19
+ * - never a line the renderer treats as code or HTML.
20
+ *
21
+ * @module converters/ncm/fix/jspwikiIndent
22
+ */
23
+ import type { FixStep } from './types.js';
24
+ export declare const jspwikiIndent: FixStep;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * JSPWiki's long plugin form → the short one (#1342).
3
+ *
4
+ * JSPWiki accepts `[{INSERT Name WHERE a=1}]`, with `INSERT` and `WHERE`
5
+ * optional, and a plugin named by its class in the default package,
6
+ * `org.apache.wiki.plugin.Name`. Ours reads the first word as the plugin
7
+ * name, so `[{INSERT CurrentTimePlugin …}]` renders nothing (a plugin called
8
+ * INSERT) and `[{org.apache.wiki.plugin.RecentChangesPlugin}]` is "not
9
+ * found". Both become `[{Name a=1}]`. Only the call's head changes; its
10
+ * parameters are left as written.
11
+ *
12
+ * Deliberately narrow:
13
+ * - only the `org.apache.wiki.plugin.` package, the one JSPWiki searches by
14
+ * default; any other package names a plugin we do not have;
15
+ * - an escaped call, `[[{INSERT …}]`, is an example and stays;
16
+ * - never in code, an HTML block or an inline code span.
17
+ *
18
+ * @module converters/ncm/fix/jspwikiInsert
19
+ */
20
+ import type { FixStep } from './types.js';
21
+ export declare const jspwikiInsert: FixStep;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * JSPWiki `''italic''` → Markdown `*italic*` (#1342).
3
+ *
4
+ * Each `''` toggles italic, as in Apache's parser (`handleApostrophe`). An
5
+ * italic run does not stop at a paragraph break: `startBlockLevel` closes it
6
+ * at the end of the block and reopens it at the start of the next, so a
7
+ * quotation of several paragraphs (or with a list inside) is italic
8
+ * throughout. Markdown emphasis cannot cross a block, so the run is closed
9
+ * with `*` on the last line of each block and reopened on the first line of
10
+ * the next — after its list marker, heading marks or quote marker.
11
+ *
12
+ * A `''` that is the whole line (a closer written on its own line) is
13
+ * dropped and its `*` goes on the neighbouring text line instead: a line
14
+ * that is only `*` would be read as an empty list item.
15
+ *
16
+ * Deliberately narrow:
17
+ * - never inside code, an HTML block, an inline code span or a
18
+ * `[{Plugin …}]` call (`caption=''` is an empty argument, not italic);
19
+ * - a page whose `''` count is odd is left alone, for review: which one is
20
+ * stray cannot be told;
21
+ * - the `*` goes before a line's closing `\` or `\\` break, never after it.
22
+ *
23
+ * The JSPWiki file converter calls this step too, so import and the NCM
24
+ * funnel read `''` one way.
25
+ *
26
+ * @module converters/ncm/fix/jspwikiItalic
27
+ */
28
+ import type { FixStep } from './types.js';
29
+ export declare const jspwikiItalic: FixStep;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Links the JSPWiki import left half-converted (#1492).
3
+ *
4
+ * The import turned `[text|url|target='_blank']` into Markdown by pieces, and
5
+ * on some pages the pieces were left glued together. Today they show as
6
+ * harmless text; once bare web addresses become links (`linkify`, #1492),
7
+ * each would become one long broken link. Three shapes, each unambiguous:
8
+ *
9
+ * - `url(url)`, the same address twice, becomes `url`;
10
+ * - `url(url|target='_blank')`, the same address twice, becomes `url`;
11
+ * - `](url|target='_blank')`, a Markdown link whose destination kept the
12
+ * JSPWiki attribute, becomes `](url)` — every external link opens in a new
13
+ * tab anyway (#1492).
14
+ *
15
+ * Deliberately narrow:
16
+ * - two different addresses in `url(other)` are left alone;
17
+ * - a wiki link split over two lines (`[Long title` then
18
+ * `|url|target='_blank']`) is left alone: which line it belongs to needs a
19
+ * reader;
20
+ * - never inside code, an HTML block or an inline code span.
21
+ *
22
+ * @module converters/ncm/fix/jspwikiLinkLeftovers
23
+ */
24
+ import type { FixStep } from './types.js';
25
+ /** Apply {@link fixText} to a line, leaving its code spans as written. */
26
+ export declare function fixLinkLeftoversInLine(line: string): string;
27
+ export declare const jspwikiLinkLeftovers: FixStep;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The JSPWiki "More Information" footer is removed (#1348).
3
+ *
4
+ * A convention from the JSPWiki years, for want of a Referring Pages tab:
5
+ *
6
+ * ## More Information
7
+ * There might be more information for this subject on one of the following:
8
+ * [{ReferringPagesPlugin before='*' after='\n' }]
9
+ *
10
+ * The page's Referring Pages tab now shows the same list, so the section goes
11
+ * (operator, 2026-09-12). The section is the heading and everything up to
12
+ * the next heading of the same or a higher level, or the end of the page.
13
+ *
14
+ * Deliberately narrow: the section is removed only when every line in it is
15
+ * one of the footer's own lines, in the variants stored pages carry — the
16
+ * sentence (also cut short, or with the plugin on the same line), "Pages
17
+ * that reference this topic:", and the plugin call (also missing its closing
18
+ * `]`). A section with anything else under the heading ("See also: …") is
19
+ * left for review. A ReferringPagesPlugin call without the heading is valid
20
+ * NCM and is left alone. Never a heading the renderer treats as code or HTML.
21
+ *
22
+ * @module converters/ncm/fix/moreInformationFooter
23
+ */
24
+ import type { FixStep } from './types.js';
25
+ export declare const moreInformationFooter: FixStep;