Skip to content

Commit

Permalink
feat(md): a标签可允许更多协议类型 (#1929)
Browse files Browse the repository at this point in the history
* fix: 修复构建报错问题

* feat(md): a标签可允许更多协议类型

* feat(md): a标签可允许更多协议类型
  • Loading branch information
GreatZPP authored Jan 3, 2025
1 parent 8112ffc commit 74389bf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,14 @@ export class MDRenderService {
}

private onIgnoreTagAttr(tag: string, name: string, value: string, isWhiteAttr: boolean) {
if (!isWhiteAttr && (name === 'id' || (tag === 'span' && name === 'style'))) {
if (!isWhiteAttr && (name === 'id' || (tag === 'span' && name === 'style')
|| (tag === 'a' && name === 'href'))) {
return name + '=' + value;
}
}

private onTagAttr(tag: string, name: string, value: string, isWhiteAttr: boolean) {
if (isWhiteAttr && (tag === 'a' && name === 'href')) {
return name + '=' + value;
}
}
Expand Down Expand Up @@ -139,6 +146,7 @@ export class MDRenderService {
html = filterXSS(html, {
whiteList: this.xssWhiteList,
onIgnoreTagAttr: this.onIgnoreTagAttr,
onTagAttr: this.onTagAttr,
css: {
whiteList: Object.assign({}, this.cssWhiteList, {
top: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/devui-vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-devui",
"version": "1.6.29",
"version": "1.6.30",
"license": "MIT",
"description": "DevUI components based on Vite and Vue3",
"keywords": [
Expand Down

0 comments on commit 74389bf

Please sign in to comment.