mirror of
https://github.com/pnp/sp-dev-fx-webparts.git
synced 2025-03-06 03:39:19 +00:00
Solve multiple spaces and max chars
This commit is contained in:
parent
405f34dd89
commit
382150261d
@ -14,12 +14,11 @@ export class SPService {
|
||||
private static GetAnchorUrl(headingValue: string): string {
|
||||
let anchorUrl = `#${headingValue
|
||||
.toLowerCase()
|
||||
.trim()
|
||||
.replace(/[{}|\[\]\<\>#@"'^%`?;:/=~\\]/g, " ")
|
||||
.replace(/^\-*|\-*$/g, "")
|
||||
.trim()
|
||||
.replace(/[{}|\[\]\<\>#@"'^%`?;:\/=~\\\s\s+]/g, " ")
|
||||
.replace(/^(-|\s)*|(-|\s)*$/g, "")
|
||||
.replace(/\'|\?|\\|\/| |\&/g, "-")
|
||||
.replace(/--+/g, "-")}`;
|
||||
.replace(/-+/g, "-")
|
||||
.substring(0, 128)}`;
|
||||
|
||||
let counter = 1;
|
||||
this.allUrls.forEach(url => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user