Skip to content

Commit 9ac1ab0

Browse files
authored
fix(TextSpacing): avoid adding spaces to other elements (qiuwenbaike#1646)
* fix(TextSpacing): avoid adding spaces to other elements * body → .mw-parser-output
1 parent c457f59 commit 9ac1ab0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

dist/TextSpacing/TextSpacing.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/TextSpacing/TextSpacing.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ const mutationObserver: MutationObserver = new MutationObserver((records: Mutati
4242
const main = (): void => {
4343
document.title = addSpaceToString(document.title);
4444
// Watch for added nodes
45-
mutationObserver.observe(document.body, {
45+
mutationObserver.observe(document.querySelector('.mw-parser-output') as HTMLElement, {
4646
subtree: true,
4747
childList: true,
4848
});
49-
run(document.body);
49+
run(document.querySelector('.mw-parser-output') as HTMLElement);
5050
};
5151

5252
$(main);

0 commit comments

Comments
 (0)