mirror of
https://github.com/drewcassidy/yaclog.git
synced 2024-09-01 14:58:58 +00:00
Fix link parsing
This commit is contained in:
parent
849438a5f5
commit
fb35ad3b29
@ -200,17 +200,18 @@ class Changelog:
|
|||||||
if match := re.fullmatch(r'\[(.*)]', version.name):
|
if match := re.fullmatch(r'\[(.*)]', version.name):
|
||||||
# ref-matched link
|
# ref-matched link
|
||||||
link_id = match[1].lower()
|
link_id = match[1].lower()
|
||||||
if link_id in self.links:
|
if link_id in links:
|
||||||
version.link = self.links.pop(link_id)
|
version.link = links.pop(link_id)
|
||||||
version.link_id = None
|
version.link_id = None
|
||||||
version.name = match[1]
|
version.name = match[1]
|
||||||
|
|
||||||
elif version.link_id in self.links:
|
elif version.link_id in links:
|
||||||
# id-matched link
|
# id-matched link
|
||||||
version.link = self.links.pop(version.link_id)
|
version.link = links.pop(version.link_id)
|
||||||
|
|
||||||
# strip whitespace from header
|
# strip whitespace from header
|
||||||
self.header = _join_markdown(header_segments)
|
self.header = _join_markdown(header_segments)
|
||||||
|
self.links = links
|
||||||
|
|
||||||
def write(self, path: os.PathLike = None):
|
def write(self, path: os.PathLike = None):
|
||||||
if path is None:
|
if path is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user