add: should be able to remove those comments

This commit is contained in:
Luke Leppan 2023-03-30 01:14:00 +02:00
parent 141c39dbb7
commit 8e7860d510
No known key found for this signature in database
GPG key ID: D35B272CE58AE00A
2 changed files with 10 additions and 1 deletions

View file

@ -10,6 +10,7 @@ import {
getWordCount,
getCitationCount,
getFootnoteCount,
cleanComments,
} from "../utils/StatUtils";
export default class StatsManager {
@ -108,6 +109,9 @@ export default class StatsManager {
}
public async change(text: string) {
if (this.plugin.settings.countComments) {
text = cleanComments(text);
}
const fileName = this.workspace.getActiveFile().path;
const currentWords = getWordCount(text);
const currentCharacters = getCharacterCount(text);

View file

@ -7,6 +7,7 @@ import {
getCitationCount,
getFootnoteCount,
getPageCount,
cleanComments,
} from "src/utils/StatUtils";
import { debounce } from "obsidian";
@ -25,7 +26,7 @@ export default class StatusBar {
);
this.statusBarEl.classList.add("mod-clickable");
this.statusBarEl.setAttribute("aria-label", "Coming Soon");
this.statusBarEl.setAttribute("aria-label", "!!!");
this.statusBarEl.setAttribute("aria-label-position", "top");
this.statusBarEl.addEventListener("click", (ev: MouseEvent) =>
this.onClick(ev)
@ -44,6 +45,10 @@ export default class StatusBar {
const sb = this.plugin.settings.statusBar;
let display = "";
if (!this.plugin.settings.countComments) {
text = cleanComments(text);
}
for (let i = 0; i < sb.length; i++) {
const sbItem = sb[i];