Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table of Contents does not update correctly when using Paragraph menu to manage headers #2851

Closed
1 task done
againey opened this issue Jan 6, 2022 · 0 comments · Fixed by #2857
Closed
1 task done
Labels
🔭 area/editor 🐛 bug Something isn't working

Comments

@againey
Copy link

againey commented Jan 6, 2022

Description

Table of contents does not strip # hash symbols correctly when using the heading-related actions in the Paragraph menu. This includes Promote Heading, Demote Heading, and the 6 items to create a heading at various levels.

  • Can you reproduce the issue?

Steps to reproduce

  1. Create a new document.
  2. Show the Table of Contents in the side bar.
  3. In the new document, create a heading by typing # Heading.
  4. Observe that the ToC shows Heading.
  5. With the cursor on the same line as this heading, select the menu item Paragraph > Demote Heading or use the shortcut Ctrl+Minus.

Alternatively:

  1. Select the menu item Paragraph > Heading 2 or use the shortcut Ctrl+2 and then type Heading.

Expected behavior:

The Table of Contents shows just the text Heading.

Actual behavior:

The Table of Contents shows the text ## Heading, failing to trim the leading hash characters.

Saving the file and viewing it in plaintext editor shows that the underlying content is fine. Closing and reopening it in Mark Text rebuilds the Table of Contents correctly.

Versions

  • MarkText version: v0.16.3
  • Operating system: Windows 11 Home 21H2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔭 area/editor 🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants