mirror of https://github.com/jumpserver/jumpserver
fix: markdown render issue
parent
b0d6a09276
commit
2f1c0090b7
|
@ -14,7 +14,7 @@
|
||||||
{% if INTERFACE.footer_content %}
|
{% if INTERFACE.footer_content %}
|
||||||
<style>
|
<style>
|
||||||
.markdown-footer a {
|
.markdown-footer a {
|
||||||
color: inherit;
|
color: #428bca;
|
||||||
}
|
}
|
||||||
|
|
||||||
.markdown-footer {
|
.markdown-footer {
|
||||||
|
@ -46,12 +46,23 @@
|
||||||
if ($('.tooltip')[0]) {
|
if ($('.tooltip')[0]) {
|
||||||
$('.tooltip').tooltip();
|
$('.tooltip').tooltip();
|
||||||
}
|
}
|
||||||
$.fn.select2.defaults.set('language', getUserLang())
|
$.fn.select2.defaults.set('language', getUserLang());
|
||||||
const md = window.markdownit();
|
const md = window.markdownit({
|
||||||
const markdownContent = document.querySelector('script[type="text/markdown"]').textContent;
|
html: true,
|
||||||
const markdownRef = document.getElementById('markdown-output')
|
linkify: true,
|
||||||
if (markdownRef) {
|
typographer: true,
|
||||||
markdownRef.innerHTML = md.render(markdownContent);
|
breaks: true
|
||||||
|
});
|
||||||
|
const markdownContent = `{{ INTERFACE.footer_content|escapejs }}`;
|
||||||
|
const markdownRef = document.getElementById('markdown-output');
|
||||||
|
|
||||||
|
if (markdownRef && markdownContent) {
|
||||||
|
const renderedContent = md.render(markdownContent.trim());
|
||||||
|
markdownRef.innerHTML = renderedContent;
|
||||||
|
markdownRef.querySelectorAll('a').forEach(link => {
|
||||||
|
link.setAttribute('target', '_blank');
|
||||||
|
link.setAttribute('rel', 'noopener noreferrer');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue