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,
|
getWordCount,
|
||||||
getCitationCount,
|
getCitationCount,
|
||||||
getFootnoteCount,
|
getFootnoteCount,
|
||||||
|
cleanComments,
|
||||||
} from "../utils/StatUtils";
|
} from "../utils/StatUtils";
|
||||||
|
|
||||||
export default class StatsManager {
|
export default class StatsManager {
|
||||||
|
@ -108,6 +109,9 @@ export default class StatsManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public async change(text: string) {
|
public async change(text: string) {
|
||||||
|
if (this.plugin.settings.countComments) {
|
||||||
|
text = cleanComments(text);
|
||||||
|
}
|
||||||
const fileName = this.workspace.getActiveFile().path;
|
const fileName = this.workspace.getActiveFile().path;
|
||||||
const currentWords = getWordCount(text);
|
const currentWords = getWordCount(text);
|
||||||
const currentCharacters = getCharacterCount(text);
|
const currentCharacters = getCharacterCount(text);
|
||||||
|
|
|
@ -7,6 +7,7 @@ import {
|
||||||
getCitationCount,
|
getCitationCount,
|
||||||
getFootnoteCount,
|
getFootnoteCount,
|
||||||
getPageCount,
|
getPageCount,
|
||||||
|
cleanComments,
|
||||||
} from "src/utils/StatUtils";
|
} from "src/utils/StatUtils";
|
||||||
import { debounce } from "obsidian";
|
import { debounce } from "obsidian";
|
||||||
|
|
||||||
|
@ -25,7 +26,7 @@ export default class StatusBar {
|
||||||
);
|
);
|
||||||
|
|
||||||
this.statusBarEl.classList.add("mod-clickable");
|
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.setAttribute("aria-label-position", "top");
|
||||||
this.statusBarEl.addEventListener("click", (ev: MouseEvent) =>
|
this.statusBarEl.addEventListener("click", (ev: MouseEvent) =>
|
||||||
this.onClick(ev)
|
this.onClick(ev)
|
||||||
|
@ -44,6 +45,10 @@ export default class StatusBar {
|
||||||
const sb = this.plugin.settings.statusBar;
|
const sb = this.plugin.settings.statusBar;
|
||||||
let display = "";
|
let display = "";
|
||||||
|
|
||||||
|
if (!this.plugin.settings.countComments) {
|
||||||
|
text = cleanComments(text);
|
||||||
|
}
|
||||||
|
|
||||||
for (let i = 0; i < sb.length; i++) {
|
for (let i = 0; i < sb.length; i++) {
|
||||||
const sbItem = sb[i];
|
const sbItem = sb[i];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue