forked from kenkeiras/org-rw
feat: Support markup inside headline titles.
This commit is contained in:
parent
baaa7cbb86
commit
0e90abbb63
4 changed files with 39 additions and 3 deletions
10
tests/09-markup-on-headline.org
Normal file
10
tests/09-markup-on-headline.org
Normal file
|
@ -0,0 +1,10 @@
|
|||
#+TITLE: 09-Markup-on-headline
|
||||
#+DESCRIPTION: Simple org file to test markup parsing on headlines
|
||||
#+TODO: TODO(t) PAUSED(p) | DONE(d)
|
||||
|
||||
|
||||
* Headline _with_ markup
|
||||
:PROPERTIES:
|
||||
:ID: 09-markup-on-headline-headline-with-markup-id
|
||||
:CREATED: [2020-01-01 Wed 01:01]
|
||||
:END:
|
|
@ -619,3 +619,18 @@ class TestSerde(unittest.TestCase):
|
|||
*** Third headline
|
||||
""".strip(),
|
||||
)
|
||||
|
||||
|
||||
def test_markup_file_09(self):
|
||||
with open(os.path.join(DIR, "09-markup-on-headline.org")) as f:
|
||||
doc = load(f)
|
||||
|
||||
hl = doc.getTopHeadlines()[0]
|
||||
print(hl.title)
|
||||
self.assertEqual(hl.title.contents, [
|
||||
'Headline ',
|
||||
MarkerToken(closing=False, tok_type=MarkerType.UNDERLINED_MODE),
|
||||
'with',
|
||||
MarkerToken(closing=True, tok_type=MarkerType.UNDERLINED_MODE),
|
||||
' markup',
|
||||
])
|
||||
|
|
|
@ -59,7 +59,7 @@ class HL:
|
|||
self.children = children
|
||||
|
||||
def assert_matches(self, test_case: unittest.TestCase, doc):
|
||||
test_case.assertEqual(self.title, doc.title)
|
||||
test_case.assertEqual(self.title, get_raw(doc.title))
|
||||
|
||||
# Check properties
|
||||
if self.props is None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue