add: should be able to remove those comments
This commit is contained in:
parent
141c39dbb7
commit
8e7860d510
2 changed files with 10 additions and 1 deletions
|
@ -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);
|
||||
|
|
|
@ -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];
|
||||
|
||||
|
|
Loading…
Reference in a new issue