@forsakringskassan/docs-generator 2.40.0 → 2.40.2

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.
@@ -967,71 +967,71 @@ function messageboxContainer(context, options, alias) {
967
967
 
968
968
  const markerStr = ":";
969
969
  const markerChar = markerStr.codePointAt(0);
970
- function containerParser(md, options) {
971
- function container(state, startLine, endLine, silent) {
972
- let pos = state.bMarks[startLine] + state.tShift[startLine];
973
- let max = state.eMarks[startLine];
974
- if (state.sCount[startLine] - state.blkIndent >= 4) {
975
- return false;
970
+ function container(state, startLine, endLine, silent) {
971
+ let pos = state.bMarks[startLine] + state.tShift[startLine];
972
+ let max = state.eMarks[startLine];
973
+ if (state.sCount[startLine] - state.blkIndent >= 4) {
974
+ return false;
975
+ }
976
+ if (pos + 3 > max) {
977
+ return false;
978
+ }
979
+ const marker = state.src.codePointAt(pos);
980
+ if (marker !== markerChar) {
981
+ return false;
982
+ }
983
+ let mem = pos;
984
+ pos = state.skipChars(pos, marker);
985
+ let len = pos - mem;
986
+ if (len < 3) {
987
+ return false;
988
+ }
989
+ const markup = state.src.slice(mem, pos);
990
+ const params = state.src.slice(pos, max).trim().split(/\s+/);
991
+ const kind = params[0];
992
+ const info = params.slice(1).join(" ");
993
+ if (silent) {
994
+ return true;
995
+ }
996
+ let nextLine = startLine;
997
+ let haveEndMarker = false;
998
+ for (; ; ) {
999
+ nextLine++;
1000
+ if (nextLine >= endLine) {
1001
+ break;
976
1002
  }
977
- if (pos + 3 > max) {
978
- return false;
1003
+ pos = mem = state.bMarks[nextLine] + state.tShift[nextLine];
1004
+ max = state.eMarks[nextLine];
1005
+ if (pos < max && state.sCount[nextLine] < state.blkIndent) {
1006
+ break;
979
1007
  }
980
- const marker = state.src.codePointAt(pos);
981
- if (marker !== markerChar) {
982
- return false;
1008
+ if (state.src.codePointAt(pos) !== marker) {
1009
+ continue;
983
1010
  }
984
- let mem = pos;
985
- pos = state.skipChars(pos, marker);
986
- let len = pos - mem;
987
- if (len < 3) {
988
- return false;
1011
+ if (state.sCount[nextLine] - state.blkIndent >= 4) {
1012
+ continue;
989
1013
  }
990
- const markup = state.src.slice(mem, pos);
991
- const params = state.src.slice(pos, max).trim().split(/\s+/);
992
- const kind = params[0];
993
- const info = params.slice(1).join(" ");
994
- if (silent) {
995
- return true;
1014
+ pos = state.skipChars(pos, marker);
1015
+ if (pos - mem < len) {
1016
+ continue;
996
1017
  }
997
- let nextLine = startLine;
998
- let haveEndMarker = false;
999
- for (; ; ) {
1000
- nextLine++;
1001
- if (nextLine >= endLine) {
1002
- break;
1003
- }
1004
- pos = mem = state.bMarks[nextLine] + state.tShift[nextLine];
1005
- max = state.eMarks[nextLine];
1006
- if (pos < max && state.sCount[nextLine] < state.blkIndent) {
1007
- break;
1008
- }
1009
- if (state.src.codePointAt(pos) !== marker) {
1010
- continue;
1011
- }
1012
- if (state.sCount[nextLine] - state.blkIndent >= 4) {
1013
- continue;
1014
- }
1015
- pos = state.skipChars(pos, marker);
1016
- if (pos - mem < len) {
1017
- continue;
1018
- }
1019
- pos = state.skipSpaces(pos);
1020
- if (pos < max) {
1021
- continue;
1022
- }
1023
- haveEndMarker = true;
1024
- break;
1018
+ pos = state.skipSpaces(pos);
1019
+ if (pos < max) {
1020
+ continue;
1025
1021
  }
1026
- len = state.sCount[startLine];
1027
- state.line = nextLine + (haveEndMarker ? 1 : 0);
1028
- const token = state.push(`doc_${kind}`, "div", 0);
1029
- token.info = info.trim();
1030
- token.content = state.getLines(startLine + 1, nextLine, len, true);
1031
- token.markup = markup;
1032
- token.map = [startLine, state.line];
1033
- return true;
1022
+ haveEndMarker = true;
1023
+ break;
1034
1024
  }
1025
+ len = state.sCount[startLine];
1026
+ state.line = nextLine + (haveEndMarker ? 1 : 0);
1027
+ const token = state.push(`doc_${kind}`, "div", 0);
1028
+ token.info = info.trim();
1029
+ token.content = state.getLines(startLine + 1, nextLine, len, true);
1030
+ token.markup = markup;
1031
+ token.map = [startLine, state.line];
1032
+ return true;
1033
+ }
1034
+ function containerParser(md, options) {
1035
1035
  md.block.ruler.before("fence", "container_include", container, {
1036
1036
  alt: ["paragraph", "reference", "blockquote", "list"]
1037
1037
  });
@@ -1212,4 +1212,4 @@ function createMarkdownRenderer(options) {
1212
1212
  }
1213
1213
 
1214
1214
  export { SoftError as S, getFingerprint as a, getOutputFilePath as b, createMarkdownRenderer as c, htmlencode as d, filePath as e, findTag as f, generateId as g, hasTag as h, isDocumentPage as i, generateExample as j, normalizePath as n, parseInfostring as p };
1215
- //# sourceMappingURL=create-markdown-renderer-BlDGOJRm.mjs.map
1215
+ //# sourceMappingURL=create-markdown-renderer-CRaoVgeB.mjs.map