hedgedoc
hedgedoc copied to clipboard
heading level >1 doesn't set the note title
Description
If the note doesn't have a level 1 heading, the title should be set by taking the first heading, whatever the level. Additionally, if a level >1 heading appears before a level 1 heading, the title should probably be taken from the former.
Steps to reproduce
Use ## test as the note content.
Expected behaviour
The note should have "test" as its title.
I changed the label to "enhancement" because the behavior isn't an error. It works as intended. Anyway, the idea is still good.
But we won't change it in HedgeDoc 1. I'll move this ticket to the development repository of the new frontend for HedgeDoc 2.
The relevant code snippet can be found here: https://github.com/hedgedoc/react-client/blob/HEAD/src/components/markdown-renderer/hooks/use-extract-first-headline.ts#L42
do we have any places in the backend that would need to generate a title? an api-endpoint perhaps? Because frontend and backend should behave the same for any given document.
The plan is that the Backend uses code from the Frontend code base for this. So it needs to be implemented only once.
This was already fixed