admin管理员组文章数量:1125027
<font style="background-color: rgb(255, 255, 0);" color="#ff0000">Write something</font>
Above tag generated by Summernote; the color property came outside of the style attribute. How can I fix this issue?" anyone found same problem that iam facing if you found let me know it will help me lot
<font style="background-color: rgb(255, 255, 0);" color="#ff0000">Write something</font>
Above tag generated by Summernote; the color property came outside of the style attribute. How can I fix this issue?" anyone found same problem that iam facing if you found let me know it will help me lot
Share Improve this question edited 2 days ago user28570838 asked 2 days ago user28570838user28570838 11 bronze badge New contributor user28570838 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct. 1 |1 Answer
Reset to default 0using <span>
with a style attribute instead of <font>
tags is more modern and widely supported you could override summernote's default behavior for formatting and ensure it generates <span>
instead of <font>
.
$('#summernote').summernote({
toolbar: [
['style', ['bold', 'italic', 'underline', 'clear']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
],
popover: {
color: [
['red', 'green', 'blue'],
['#800000', '#013220', '#00008B'],
],
},
callbacks: {
onChange: function(contents) {
// replacing <font> tag with <span> tag
const fixedContents = contents.replace(
/<font([^>]*?)color="([^"]*?)"/g,
'<span$1 style="color:$2;"'
).replace(/<\/font>/g, '</span>');
console.log(fixedContents); // for debugging
},
},
});
本文标签: djangofont Tag issue in summer noteStack Overflow
版权声明:本文标题:django - font Tag issue in summer note - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736619084a1945534.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
color
is a valid attribute in a<font>
tag. What issue are you having? Is the font colour not showing red? – Musa Commented yesterday