>/g,(function(){return"(?:"+a+"|"+d+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o("\\d{4}-\\d\\d?-\\d\\d?(?:[tT]|[ \t]+)\\d\\d?:\\d{2}:\\d{2}(?:\\.\\d*)?(?:[ \t]*(?:Z|[-+]\\d\\d?(?::\\d{2})?))?|\\d{4}-\\d{2}-\\d{2}|\\d\\d?:\\d{2}(?::\\d{2}(?:\\.\\d*)?)?"),lookbehind:!0,alias:"number"},boolean:{pattern:o("false|true","i"),lookbehind:!0,alias:"important"},null:{pattern:o("null|~","i"),lookbehind:!0,alias:"important"},string:{pattern:o(d),lookbehind:!0,greedy:!0},number:{pattern:o("[+-]?(?:0x[\\da-f]+|0o[0-7]+|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)","i"),lookbehind:!0},tag:r,important:n,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(Prism);
\ No newline at end of file
diff --git a/app/thirdparty/assets/prism/index.html b/app/thirdparty/assets/prism/index.html
deleted file mode 100644
index 029fe06d70..0000000000
--- a/app/thirdparty/assets/prism/index.html
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-Code
-CPP code block
-#include <iostream>
-using namespace std;
-
-int main()
-{
- cout << "hello" << endl;
- return 0;
-}
-
-
-
-
-
-
diff --git a/app/thirdparty/assets/prism/main.js b/app/thirdparty/assets/prism/main.js
new file mode 100644
index 0000000000..883ebef635
--- /dev/null
+++ b/app/thirdparty/assets/prism/main.js
@@ -0,0 +1,7 @@
+function wrapCodeBlockWords() {
+ let preElements = document.querySelectorAll("pre[class*='language-']");
+ preElements.forEach((element) => {
+ element.style.whiteSpace = "pre-wrap";
+ element.style.overflowWrap = "break-word";
+ });
+}
diff --git a/app/thirdparty/assets/prism/plugins/line-numbers/main.js b/app/thirdparty/assets/prism/plugins/line-numbers/main.js
new file mode 100644
index 0000000000..0956d781d0
--- /dev/null
+++ b/app/thirdparty/assets/prism/plugins/line-numbers/main.js
@@ -0,0 +1,41 @@
+function enableLineNumbers() {
+ document.body.classList.add("line-numbers");
+}
+
+function adjustLineNumbers() {
+ const preElements = document.querySelectorAll("pre[class*='language-']");
+ let fontWidth = -1;
+
+ preElements.forEach((element) => {
+ let codeElement = element.querySelector("code");
+ if (codeElement) {
+ const maxNumber = codeElement.textContent.split("\n").length - 1;
+ if (maxNumber == 0) {
+ return;
+ }
+
+ if (fontWidth == -1) {
+ const canvasContext = document.createElement("canvas").getContext("2d");
+ canvasContext.font = window.getComputedStyle(codeElement, null).getPropertyValue("font");
+ fontWidth = canvasContext.measureText("0").width;
+ }
+
+ const digits = getNumberDigits(maxNumber);
+ element.style.paddingLeft = 2 * fontWidth + digits * fontWidth - digits + "px";
+ }
+ });
+}
+
+function getNumberDigits(number) {
+ if (number < 10) {
+ return 1;
+ } else if (number < 100) {
+ return 2;
+ } else if (number < 1000) {
+ return 3;
+ } else if (number < 10000) {
+ return 4;
+ } else {
+ return 5;
+ }
+}
diff --git a/app/thirdparty/assets/prism/plugins/line-numbers/prism-line-numbers.css b/app/thirdparty/assets/prism/plugins/line-numbers/prism-line-numbers.css
deleted file mode 100644
index ace8f23ffa..0000000000
--- a/app/thirdparty/assets/prism/plugins/line-numbers/prism-line-numbers.css
+++ /dev/null
@@ -1,40 +0,0 @@
-pre[class*="language-"].line-numbers {
- position: relative;
- padding-left: 2.6em;
- counter-reset: linenumber;
-}
-
-pre[class*="language-"].line-numbers>code {
- position: relative;
- white-space: inherit;
-}
-
-.line-numbers .line-numbers-rows {
- position: absolute;
- pointer-events: none;
- top: 0;
- font-size: 100%;
- left: -3.4em;
- width: 3em;
- /* works for line-numbers below 1000 lines */
- letter-spacing: -1px;
- border-right: 1px solid #999;
-
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-}
-
-.line-numbers-rows>span {
- display: block;
- counter-increment: linenumber;
-}
-
-.line-numbers-rows>span:before {
- content: counter(linenumber);
- color: #999;
- display: block;
- padding-right: 0.4em;
- text-align: right;
-}
diff --git a/app/thirdparty/assets/prism/plugins/line-numbers/style.css b/app/thirdparty/assets/prism/plugins/line-numbers/style.css
new file mode 100644
index 0000000000..a5a6c0dfd2
--- /dev/null
+++ b/app/thirdparty/assets/prism/plugins/line-numbers/style.css
@@ -0,0 +1,28 @@
+.line-numbers .line-numbers-rows {
+ position: absolute;
+ pointer-events: none;
+ top: 0;
+ font-size: 100%;
+ left: -5.3em;
+ width: 5em;
+ letter-spacing: -1px;
+ border-right: 1px solid #999;
+
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+}
+
+.line-numbers-rows > span {
+ display: block;
+ counter-increment: linenumber;
+}
+
+.line-numbers-rows > span:before {
+ content: counter(linenumber);
+ color: #999;
+ display: block;
+ padding-right: 0.3em; /* padding right of line numbers */
+ text-align: right;
+}
diff --git a/app/thirdparty/assets/prism/style.css b/app/thirdparty/assets/prism/style.css
new file mode 100644
index 0000000000..8b612e2564
--- /dev/null
+++ b/app/thirdparty/assets/prism/style.css
@@ -0,0 +1,11 @@
+pre[class*="language-"] {
+ position: relative;
+ padding-left: 0.8em; /* padding left of codes */
+ counter-reset: linenumber;
+}
+
+pre[class*="language-"] > code {
+ position: relative;
+ white-space: inherit;
+ overflow-wrap: inherit;
+}
diff --git a/app/thirdparty/assets/prism/version b/app/thirdparty/assets/prism/version
new file mode 100644
index 0000000000..ecacfbe84b
--- /dev/null
+++ b/app/thirdparty/assets/prism/version
@@ -0,0 +1 @@
+Prism v1.29.0
\ No newline at end of file
diff --git a/app/thirdparty/java/other/flexmark/ext/codeblocks/LineNumbersAttributeProvider.java b/app/thirdparty/java/other/flexmark/ext/codeblocks/LineNumbersAttributeProvider.java
deleted file mode 100644
index 97fd8e8f28..0000000000
--- a/app/thirdparty/java/other/flexmark/ext/codeblocks/LineNumbersAttributeProvider.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*#######################################################
- * flexmark-ext-prism-linenumber
- *
- * Copyright Tom Misawa
- * Source: https://github.com/riversun/flexmark-ext-prism-linenumber
- * License: MIT
-#########################################################*/
-
-package other.flexmark.ext.codeblocks;
-
-import com.vladsch.flexmark.ast.FencedCodeBlock;
-import com.vladsch.flexmark.html.AttributeProvider;
-import com.vladsch.flexmark.html.AttributeProviderFactory;
-import com.vladsch.flexmark.html.IndependentAttributeProviderFactory;
-import com.vladsch.flexmark.html.renderer.AttributablePart;
-import com.vladsch.flexmark.html.renderer.LinkResolverContext;
-import com.vladsch.flexmark.util.ast.Node;
-import com.vladsch.flexmark.util.html.Attributes;
-
-import java.util.Objects;
-
-/**
- * AttributeProvider of flexmark-java extension for prism syntax highlighter.
- */
-public class LineNumbersAttributeProvider implements AttributeProvider {
-
- static AttributeProviderFactory Factory() {
- return new IndependentAttributeProviderFactory() {
-
- @Override
- public AttributeProvider create(LinkResolverContext context) {
- return new LineNumbersAttributeProvider();
- }
- };
- }
-
- @Override
- public void setAttributes(Node node, AttributablePart part, Attributes attributes) {
- if (node instanceof FencedCodeBlock && part == AttributablePart.NODE) {
- if (Objects.equals(((FencedCodeBlock) node).getInfo(), "mermaid")) {
- return;
- }
- attributes.replaceValue("class", "line-numbers");
- }
- }
-}
\ No newline at end of file
diff --git a/app/thirdparty/java/other/flexmark/ext/codeblocks/LineNumbersExtension.java b/app/thirdparty/java/other/flexmark/ext/codeblocks/LineNumbersExtension.java
deleted file mode 100644
index 5162f71913..0000000000
--- a/app/thirdparty/java/other/flexmark/ext/codeblocks/LineNumbersExtension.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*#######################################################
- * flexmark-ext-prism-linenumber
- *
- * Copyright Tom Misawa
- * Source: https://github.com/riversun/flexmark-ext-prism-linenumber
- * License: MIT
-#########################################################*/
-package other.flexmark.ext.codeblocks;
-
-import com.vladsch.flexmark.html.HtmlRenderer;
-import com.vladsch.flexmark.util.options.MutableDataHolder;
-
-/**
- * flexmark-java extension for prism syntax highlighter.
- */
-public class LineNumbersExtension implements HtmlRenderer.HtmlRendererExtension {
- @Override
- public void rendererOptions(final MutableDataHolder options) {
- }
-
- @Override
- public void extend(final HtmlRenderer.Builder rendererBuilder, final String rendererType) {
- rendererBuilder.attributeProviderFactory(LineNumbersAttributeProvider.Factory());
- }
-
- public static LineNumbersExtension create() {
- return new LineNumbersExtension();
- }
-}
\ No newline at end of file
diff --git a/doc/assets/2023-10-11-line-numbers.webp b/doc/assets/2023-10-11-line-numbers.webp
index e75161b638..c35ca56808 100644
Binary files a/doc/assets/2023-10-11-line-numbers.webp and b/doc/assets/2023-10-11-line-numbers.webp differ