Просмотр исходного кода

着重点功能调整

富文本屏蔽超链接打开位置
zq 2 недель назад
Родитель
Сommit
20dec1f071
2 измененных файлов с 13 добавлено и 1 удалено
  1. 12 0
      src/styles/index.scss
  2. 1 1
      src/utils/common.js

+ 12 - 0
src/styles/index.scss

@@ -90,6 +90,18 @@ ul {
   ol li {
     list-style: decimal;
   }
+  
+}
+
+/* 富文本着重点 */
+.rich-text-emphasis-dot {
+  display: inline;
+  padding-bottom: 0.2em; /* 间距也相对于字体 */
+  background-image: radial-gradient(circle at center, currentColor 0.15em, /* 圆点大小相对于字体 */ transparent 0.16em);
+  background-repeat: repeat-x;
+  background-position: 0 100%;
+  background-size: 1em 0.3em; /* 间距相对于字体大小,高度相对字体 */
+  border-bottom: none;
 }
 
 .card {

+ 1 - 1
src/utils/common.js

@@ -147,5 +147,5 @@ export function getArrayDepth(arr) {
  * @returns {string} 过滤后的html
  */
 export function sanitizeHTML(html) {
-  return DOMPurify.sanitize(html);
+  return DOMPurify.sanitize(html, { ADD_ATTR: ['target'] });
 }