Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Specification Tools
Scripts
Commits
c6f007f3
Commit
c6f007f3
authored
1 year ago
by
Andreas Kraft
Browse files
Options
Downloads
Patches
Plain Diff
Fixed missing links when multiple references are in the same line
parent
c90c14c1
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
toMkdocs/toMkdocs.py
+3
-2
3 additions, 2 deletions
toMkdocs/toMkdocs.py
with
3 additions
and
2 deletions
toMkdocs/toMkdocs.py
+
3
−
2
View file @
c6f007f3
...
@@ -219,6 +219,7 @@ def updateLinks(clauses:list[Clause]) -> list[Clause]:
...
@@ -219,6 +219,7 @@ def updateLinks(clauses:list[Clause]) -> list[Clause]:
if
(
anchors
:
=
_htmlAnchorLink
.
findall
(
line
)):
if
(
anchors
:
=
_htmlAnchorLink
.
findall
(
line
)):
for
a
in
anchors
:
for
a
in
anchors
:
linkTargets
[
f
'
#
{
a
}
'
]
=
(
i
,
clause
)
linkTargets
[
f
'
#
{
a
}
'
]
=
(
i
,
clause
)
print
(
f
'
[green]Found anchor
"
{
a
}
"
in clause
"
{
clause
.
title
}
"'
)
# Replace the html links
# Replace the html links
for
clause
in
clauses
:
for
clause
in
clauses
:
...
@@ -227,7 +228,7 @@ def updateLinks(clauses:list[Clause]) -> list[Clause]:
...
@@ -227,7 +228,7 @@ def updateLinks(clauses:list[Clause]) -> list[Clause]:
for
lnk
in
links
:
for
lnk
in
links
:
width
=
4
width
=
4
if
lnk
in
linkTargets
:
if
lnk
in
linkTargets
:
clause
.
lines
[
i
]
=
line
.
replace
(
lnk
,
f
'
../
{
linkTargets
[
lnk
][
0
]
:
0
{
width
}}
/#
{
lnk
[
1
:
]
}
'
)
line
=
clause
.
lines
[
i
]
=
line
.
replace
(
lnk
,
f
'
../
{
linkTargets
[
lnk
][
0
]
:
0
{
width
}}
/#
{
lnk
[
1
:
]
}
'
)
# Update the current line as well
# Replace the markdown links
# Replace the markdown links
for
clause
in
clauses
:
for
clause
in
clauses
:
...
@@ -235,7 +236,7 @@ def updateLinks(clauses:list[Clause]) -> list[Clause]:
...
@@ -235,7 +236,7 @@ def updateLinks(clauses:list[Clause]) -> list[Clause]:
if
(
links
:
=
_markdownLink
.
findall
(
line
)):
if
(
links
:
=
_markdownLink
.
findall
(
line
)):
for
lnk
in
links
:
for
lnk
in
links
:
if
lnk
in
linkTargets
:
if
lnk
in
linkTargets
:
clause
.
lines
[
i
]
=
line
.
replace
(
lnk
,
f
'
../
{
linkTargets
[
lnk
][
0
]
:
0
{
fnLength
}}
/#
{
lnk
[
1
:
]
}
'
)
line
=
clause
.
lines
[
i
]
=
line
.
replace
(
lnk
,
f
'
../
{
linkTargets
[
lnk
][
0
]
:
0
{
fnLength
}}
/#
{
lnk
[
1
:
]
}
'
)
# Update the current line as well
return
clauses
return
clauses
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment