forked from Gitlink/forgeplus-react
Merge pull request 'reposyncer更新' (#726) from durian/forgeplus-react:pre_gitlink_ssr into pre_gitlink_ssr
This commit is contained in:
commit
a29b3dc579
|
|
@ -150,6 +150,16 @@ renderer.code = function (code, infostring, escaped) {
|
|||
|
||||
}
|
||||
|
||||
function cleanString(str) {
|
||||
// 移除整个HTML标签及其内容
|
||||
let cleanedStr = str.replace(/<[^>]*>[^<]*<\/[^>]*>/g, '');
|
||||
// 移除剩余的HTML标签
|
||||
cleanedStr = cleanedStr.replace(/<[^>]*>/g, '');
|
||||
// 移除特殊字符
|
||||
cleanedStr = cleanedStr.replace(/[.,/#!$%^&*;:{}=\-_`~():,。¥;「」|?》《~·【】‘、!]/g, '');
|
||||
return cleanedStr;
|
||||
}
|
||||
|
||||
renderer.heading = function (text, level, raw) {
|
||||
let anchor = this.options.headerPrefix + raw.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g, '-');
|
||||
toc.push({
|
||||
|
|
@ -157,7 +167,7 @@ renderer.heading = function (text, level, raw) {
|
|||
level: level,
|
||||
text: text
|
||||
})
|
||||
let id = anchor.replace(/[.,/#!$%^&*;:{}=\-_`~():,。¥;「」|?》《~·【】‘、!]/g,"");
|
||||
let id = cleanString(anchor);
|
||||
return '<h' + level + ' id="' + id + '" class="markdown_anchors"><a name="#'+id+'" class="anchors"><i class="iconfont icon-lianjieicon font-14"></i></a>' + text + '</h' + level + '>'
|
||||
}
|
||||
marked.setOptions({
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
cursor: pointer;
|
||||
transition: 1s;
|
||||
.grow_path_type {
|
||||
width: 82px;
|
||||
// width: 82px;
|
||||
height: 58px;
|
||||
// color: black;
|
||||
font-size: 15px;
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ function EditStore(props){
|
|||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item label={`${platform}同步仓库地址(仅支持个人仓库,组织仓库暂不支持)`} className="storeFormItem" hidden={step || !platform}>
|
||||
<Form.Item label={`${platform}同步仓库地址`} className="storeFormItem" hidden={step || !platform}>
|
||||
{getFieldDecorator("external_repo_address",{
|
||||
rules:[
|
||||
{required:true,message: `请输入${platform || ""}同步仓库地址`},
|
||||
|
|
|
|||
Loading…
Reference in New Issue