mirror of
https://github.com/tiennm99/MTTools.git
synced 2026-10-11 03:13:42 +00:00
2855ce5e533f0284c5b8517b6c78787c08473964
Three blocks the site injects inside the chapter body were being extracted as prose: the sponsor block, a source watermark planted mid-chapter, and the prev/next chapter links. Anchors and images are now skipped, since inside a chapter body they are always site chrome, and the sponsor wrapper and watermark are skipped by class. Inline emphasis tags are left alone so italics in the prose survive. The sponsor wrapper has a sibling that must NOT be skipped: on most chapters the real text sits in a container hidden with display:none, because the body is gated behind a click on the sponsor link and revealed with JavaScript. Skipping hidden elements, or treating the two sibling classes as one family, discards the entire chapter. A test pins the gated body as kept while its sibling is dropped. Removes 662 words of injected text across the sample novel and lets the repeated chapter-number paragraph be recognised again, which the sponsor block had been masking by displacing it from the top of the body.
Description
Personal toolbox — utility scripts and small CLI tools (shell/batch, Go, Python, Node.js), merged from standalone repos with full history
16 MiB
0 Stars
1 Watchers
0 Forks
Languages
Go
75%
Python
22.9%
Shell
0.8%
JavaScript
0.7%
Dockerfile
0.4%
Other
0.2%