mirror of
https://github.com/gogs/gogs.git
synced 2026-02-02 12:39:24 +01:00
chore: update mermaid to 11.9.0 (#8009)
Co-authored-by: ᴊᴏᴇ ᴄʜᴇɴ <jc@unknwon.io>
This commit is contained in:
@@ -12,6 +12,7 @@ All notable changes to Gogs are documented in this file.
|
||||
|
||||
- The required Go version to compile source code changed to 1.24.
|
||||
- The build tag `cert` has been removed, and the `gogs cert` subcommand is now always available. [#7883](https://github.com/gogs/gogs/pull/7883)
|
||||
- Updated Mermaid JS to 11.9.0. [#8009](https://github.com/gogs/gogs/pull/8009)
|
||||
|
||||
### Fixed
|
||||
|
||||
|
||||
2029
public/plugins/mermaid-10.9.1/mermaid.min.js
vendored
2029
public/plugins/mermaid-10.9.1/mermaid.min.js
vendored
File diff suppressed because one or more lines are too long
2659
public/plugins/mermaid-11.9.0/mermaid.min.js
vendored
Normal file
2659
public/plugins/mermaid-11.9.0/mermaid.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@@ -59,10 +59,49 @@
|
||||
<script src="{{AppSubURL}}/plugins/autosize-4.0.2/autosize.min.js"></script>
|
||||
{{end}}
|
||||
{{if .IsMarkdown}}
|
||||
<script src="{{AppSubURL}}/plugins/mermaid-10.9.1/mermaid.min.js"></script>
|
||||
<script src="{{AppSubURL}}/plugins/mermaid-11.9.0/mermaid.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
mermaid.init({startOnLoad: true, noteMargin: 10}, ".language-mermaid");
|
||||
const deepMerge = function(target, source) {
|
||||
// Create a deep copy of the target to avoid modifying the original
|
||||
const output = { ...target };
|
||||
|
||||
if (target && typeof target === 'object' && source && typeof source === 'object') {
|
||||
for (const key in source) {
|
||||
if (source.hasOwnProperty(key)) {
|
||||
if (source[key] instanceof Object && target[key] instanceof Object) {
|
||||
// If both are objects, recursively merge
|
||||
output[key] = deepMerge(target[key], source[key]);
|
||||
} else if (Array.isArray(source[key]) && Array.isArray(target[key])) {
|
||||
// If both are arrays, concatenate them
|
||||
output[key] = [...target[key], ...source[key]];
|
||||
} else {
|
||||
// Otherwise, overwrite with the source value
|
||||
output[key] = source[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return output;
|
||||
};
|
||||
|
||||
let initializeOpts = { startOnLoad: false, sequence: {noteMargin: 10}, journey: {noteMargin: 10}, timeline: {noteMargin: 10}, state: {noteMargin: 10} };
|
||||
|
||||
if (window.MERMAID_INITIALIZE_OPTIONS) {
|
||||
// allow customization in inject/head.tmpl
|
||||
initializeOpts = deepMerge(initializeOpts, window.MERMAID_INITIALIZE_OPTIONS);
|
||||
}
|
||||
|
||||
mermaid.initialize(initializeOpts);
|
||||
|
||||
let runOpts = { querySelector: '.language-mermaid' };
|
||||
if (window.MERMAID_RUN_OPTIONS) {
|
||||
// allow customization in inject/head.tmpl
|
||||
runOpts = deepMerge(runOpts, window.MERMAID_RUN_OPTIONS);
|
||||
}
|
||||
|
||||
mermaid.run(runOpts);
|
||||
});
|
||||
</script>
|
||||
{{end}}
|
||||
|
||||
Reference in New Issue
Block a user