securemark 0.283.2 → 0.283.3

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 (36) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/index.js +86 -48
  3. package/package.json +1 -1
  4. package/src/combinator/control/manipulation/indent.ts +1 -1
  5. package/src/combinator/data/parser/context/delimiter.ts +28 -3
  6. package/src/combinator/data/parser/context.ts +5 -2
  7. package/src/parser/block/dlist.ts +1 -1
  8. package/src/parser/context.ts +2 -2
  9. package/src/parser/inline/annotation.ts +2 -2
  10. package/src/parser/inline/autolink/url.ts +2 -2
  11. package/src/parser/inline/autolink.ts +1 -1
  12. package/src/parser/inline/bracket.ts +17 -14
  13. package/src/parser/inline/code.ts +1 -1
  14. package/src/parser/inline/deletion.ts +1 -1
  15. package/src/parser/inline/emphasis.test.ts +2 -2
  16. package/src/parser/inline/emphasis.ts +3 -3
  17. package/src/parser/inline/emstrong.ts +7 -7
  18. package/src/parser/inline/extension/index.ts +3 -3
  19. package/src/parser/inline/extension/indexee.ts +4 -2
  20. package/src/parser/inline/extension/placeholder.ts +2 -2
  21. package/src/parser/inline/html.ts +4 -4
  22. package/src/parser/inline/htmlentity.ts +5 -5
  23. package/src/parser/inline/insertion.ts +1 -1
  24. package/src/parser/inline/link.ts +4 -4
  25. package/src/parser/inline/mark.test.ts +2 -2
  26. package/src/parser/inline/mark.ts +3 -3
  27. package/src/parser/inline/math.ts +2 -2
  28. package/src/parser/inline/media.ts +2 -2
  29. package/src/parser/inline/reference.ts +2 -2
  30. package/src/parser/inline/remark.ts +2 -2
  31. package/src/parser/inline/ruby.ts +2 -2
  32. package/src/parser/inline/strong.test.ts +2 -2
  33. package/src/parser/inline/strong.ts +3 -3
  34. package/src/parser/inline/template.ts +2 -2
  35. package/src/parser/inline.test.ts +4 -2
  36. package/src/parser/visibility.ts +4 -4
@@ -120,7 +120,7 @@ export function isStartTightNodes(nodes: readonly (HTMLElement | string)[]): boo
120
120
  }
121
121
  //export function isEndTightNodes(nodes: readonly (HTMLElement | string)[]): boolean {
122
122
  // if (nodes.length === 0) return true;
123
- // return isVisible(nodes[nodes.length - 1], -1);
123
+ // return isVisible(nodes.at(-1)!, -1);
124
124
  //}
125
125
  function isVisible(node: HTMLElement | string, strpos?: number): boolean {
126
126
  switch (typeof node) {
@@ -186,11 +186,11 @@ function trimBlankEnd<T extends HTMLElement | string>(parser: Parser<T>): Parser
186
186
  //}
187
187
  export function trimNodeEnd<T extends HTMLElement | string>(nodes: T[]): T[] {
188
188
  const skip = nodes.length > 0 &&
189
- typeof nodes[nodes.length - 1] === 'object' &&
190
- nodes[nodes.length - 1]['className'] === 'indexer'
189
+ typeof nodes.at(-1) === 'object' &&
190
+ nodes.at(-1)!['className'] === 'indexer'
191
191
  ? [nodes.pop()!]
192
192
  : [];
193
- for (let node = nodes[0]; nodes.length > 0 && !isVisible(node = nodes[nodes.length - 1], -1);) {
193
+ for (let node = nodes[0]; nodes.length > 0 && !isVisible(node = nodes.at(-1)!, -1);) {
194
194
  if (typeof node === 'string') {
195
195
  const pos = node.trimEnd().length;
196
196
  if (pos > 0) {