Skip to content

Commit 34f1b98

Browse files
committed
add functino to clean up title formatting
1 parent fcda454 commit 34f1b98

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

helper-scripts/influxdb3-plugins/port_to_docs.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,22 @@ function removeEmojiMetadata(content) {
3434
return content.replace(pattern, '');
3535
}
3636

37+
/**
38+
* Clean up title formatting.
39+
*/
40+
function cleanTitle(content) {
41+
// Remove duplicate # from titles (e.g., "# # Title" -> "# Title")
42+
content = content.replace(/^#\s+#\s+(.+)$/m, '# $1');
43+
return content;
44+
}
45+
3746
/**
3847
* Convert relative links to GitHub URLs.
3948
*/
4049
function convertRelativeLinks(content, pluginName) {
4150
const baseUrl = `https://github.com/influxdata/influxdb3_plugins/blob/master/influxdata/${pluginName}/`;
42-
const rootUrl = 'https://github.com/influxdata/influxdb3_plugins/blob/master/';
51+
const rootUrl =
52+
'https://github.com/influxdata/influxdb3_plugins/blob/master/';
4353

4454
// Convert relative README links (../../README.md, ../README.md, etc.)
4555
content = content.replace(

0 commit comments

Comments
 (0)