Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/insert-or-navigate-footnotes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,14 @@ export function addFootnoteSectionHeader(
// else, return ""

if (plugin.settings.enableFootnoteSectionHeading == true) {
let returnHeading = `\n# ${plugin.settings.FootnoteSectionHeading}`;

let returnHeading = plugin.settings.FootnoteSectionHeading;
const headingRegex = /^\#{1,6} /;
if (headingRegex.test(returnHeading)) {
returnHeading = `\n${returnHeading}`;
} else {
returnHeading = `\n# ${returnHeading}`;
}
return returnHeading;
}
return "";
Expand Down
2 changes: 1 addition & 1 deletion src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class FootnotePluginSettingTab extends PluginSettingTab {

new Setting(containerEl)
.setName("Footnote Section Heading")
.setDesc("Heading to place above footnotes section (Supports Markdown formatting). Heading will be H1 size.")
.setDesc("Heading to place above footnotes section (Supports Markdown formatting). Heading will be H1 size, unless overridden.")
.addText((text) =>
text
.setPlaceholder("Heading is Empty")
Expand Down