Fix the table of content for room versions#1884
Merged
turt2live merged 5 commits intomatrix-org:mainfrom Jun 20, 2024
Merged
Conversation
Like for the cs-module shortcode, use .RenderShortcodes instead of .Content for the rver-fragment shortcode, so the headings are detected by Hugo. Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
…shortcodes Now that we use .RenderShortcodes in the rver-fragment shortcode, we cannot remove the output of these shortcodes dynamically because they are replaced by a temporary placeholder due to Hugo's internals. Instead, since the `this` parameter was only used for room version, we always use the `v` parameter and compare with the version provided in the page's front matter. Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Member
|
https://spec.matrix.org/unstable/rooms/v11/ (and others) appear to be working fine right now. Is there a place where we can see the bug? |
Contributor
Author
Member
|
oh my. That's dangerous. Ideally we'd have CI for this, but that's not a problem for this PR to solve. |
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
53 tasks
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


We need to use
.RenderShortcodesfor room version pages like in #1851, otherwise the headings in the included fragments are not present in the ToC of the page.However, that breaks the
withVersioningtrick, because the output we get has shortcodes replaced by temporary opaque strings, so we cannot detect them to remove them. The solution I found is to use a page parameter in theadded-inandchanged-inshortcodes to detect if the current version is the same as thevparameter, since it seems to be the only way to pass a variable from the rendered page to the shortcode in the fragment.Pull Request Checklist
Preview: https://pr1884--matrix-spec-previews.netlify.app