File size: 1,017 Bytes
0b7eb60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a39481c..a338c44 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## Unreleased
+
+- Fix a rendering bug when line breaks exist in a link text. [#126](https://github.com/frostming/marko/issue/126)
+
 ## v1.2.2(2022-09-22)
 
 - Fix a bug of markdown renderer, the ordered list index isn't increasing. [#112](https://github.com/frostming/marko/pull/112)
diff --git a/marko/inline.py b/marko/inline.py
index f497132..a1fc175 100644
--- a/marko/inline.py
+++ b/marko/inline.py
@@ -80,6 +80,7 @@ class LineBreak(InlineElement):
 
     def __init__(self, match: "_Match") -> None:
         self.soft = not match.group(1).startswith(("  ", "\\"))
+        self.children = "\n"
 
 
 class InlineHTML(InlineElement):
@@ -190,9 +191,6 @@ class RawText(InlineElement):
 
     virtual = True
 
-    if TYPE_CHECKING:
-        children: str
-
     def __init__(self, match: str, escape: bool = True) -> None:
         self.children = match
         self.escape = escape