mirror of
https://github.com/pnp/sp-dev-fx-webparts.git
synced 2025-03-06 11:49:23 +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 {
|
private static GetAnchorUrl(headingValue: string): string {
|
||||||
let anchorUrl = `#${headingValue
|
let anchorUrl = `#${headingValue
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.trim()
|
.replace(/[{}|\[\]\<\>#@"'^%`?;:\/=~\\\s\s+]/g, " ")
|
||||||
.replace(/[{}|\[\]\<\>#@"'^%`?;:/=~\\]/g, " ")
|
.replace(/^(-|\s)*|(-|\s)*$/g, "")
|
||||||
.replace(/^\-*|\-*$/g, "")
|
|
||||||
.trim()
|
|
||||||
.replace(/\'|\?|\\|\/| |\&/g, "-")
|
.replace(/\'|\?|\\|\/| |\&/g, "-")
|
||||||
.replace(/--+/g, "-")}`;
|
.replace(/-+/g, "-")
|
||||||
|
.substring(0, 128)}`;
|
||||||
|
|
||||||
let counter = 1;
|
let counter = 1;
|
||||||
this.allUrls.forEach(url => {
|
this.allUrls.forEach(url => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user