fix: TOC anchor navigation - remove anchor text from parsed content
- Fix parse_blocks: after extracting anchor from \\x03..\\x04 markers, remove the anchor text too (was contaminating display text) - When TOC jump occurs, clear pending_anchor to prevent saved position from overriding the TOC navigation on first frame - Add tests for heading with/without anchor parsing
This commit is contained in:
@@ -382,6 +382,7 @@ BgType::Custom(ref path) if !path.is_empty() => {
|
||||
if let Some(section) = action.jump_to_section {
|
||||
self.state.current_section = section;
|
||||
self.state.current_page = 0;
|
||||
self.state.pending_anchor = None;
|
||||
if let Some(ref anchor) = action.jump_to_anchor {
|
||||
if let Some(ref book) = self.state.book {
|
||||
if section < book.sections.len() {
|
||||
|
||||
Reference in New Issue
Block a user