MCPcopy Create free account
hub / github.com/DavidWells/analytics / formatContent

Function formatContent

site/sync.js:84–102  ·  view source on GitHub ↗
(content)

Source from the content-addressed store, hash-verified

82}
83
84function formatContent(content) {
85 const removeContentRegex = /<!--.*stripFromDocsSTART((.|\n)*?END.*-->)/g
86 const mdMagicRegex = /<!--.*AUTO-GENERATED-CONTENT:START((.|\n)*?END.*-->)/g
87
88 return content
89 // Remove first h1
90 .replace(/^#(.*)/m, '')
91 // remove blocks
92 .replace(removeContentRegex, '')
93 // remove redudant view docs link
94 .replace(/\[View the docs\]\(.*\)\.?/, '')
95 .replace(/For more information \[see the docs\]\(.*\)\.?/, '')
96 // remove md magic blocks
97 // .replace(mdMagicRegex, '')
98 .replace('<!--', '---')
99 .replace('-->', '---')
100 // Replace multiple blank lines
101 .replace(/^\s*\n/gm, '\n')
102}
103
104function removeGithubSpecificContent(content) {
105 const docLinkRegex = /<!--.*stripFromDocsSTART((.|\n)*?END.*-->)/g

Callers 1

updateContentsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected