feat(*): allow internal link to point to customized anchors in a page#107
Draft
c-forrest wants to merge 3 commits intoOI-wiki:masterfrom
Draft
feat(*): allow internal link to point to customized anchors in a page#107c-forrest wants to merge 3 commits intoOI-wiki:masterfrom
c-forrest wants to merge 3 commits intoOI-wiki:masterfrom
Conversation
2671e94 to
1dad854
Compare
1 task
947fa6c to
ce69819
Compare
cb48ad7 to
1226c00
Compare
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.
closes OI-wiki/OI-wiki#6480
本次 PR 主要实现了如下功能:
<a id="ref-id"></a>的 anchor,并在相应的文档里插入一个相应的 anchor/^<a\b[^>]*\bid="([^"]+)"[^>]*>$/u,即要求字符串以<a开始>结尾,且包含一个id字段,其中,id字段必须以双引号包围PageName-AnchorID,这一格式有助于后文 typst 识别所在的 sectionjoinRelative的实现,允许识别裸 anchor 的情形,即[Something](#ref-id)@ref-id[complement]格式引用任意位置锚点,并输出小节序号和引用所在页码#h(2em),否则 typst 会在 pdf 里添加一个空白行为查看实际效果,请参考 PDF 的如下章节: