Skip to content

Fix nested markup and add tests#25

Closed
kovariance wants to merge 1 commit intotecosaur:mainfrom
kovariance:unit-tests
Closed

Fix nested markup and add tests#25
kovariance wants to merge 1 commit intotecosaur:mainfrom
kovariance:unit-tests

Conversation

@kovariance
Copy link
Contributor

The main purpose of this PR is to add some unit tests. Not a lot (~8% coverage). Along the way, I discovered a couple of bugs.

Firstly, nested inline markup did not parse as expected. Evaluating parsetree(org"*/text/*") returned the following:

Org Parse Tree
    Section
        Paragraph
            TextBold
                TextPlain "/text/"

It now returns the following:

Org Parse Tree
    Section
        Paragraph
            TextBold
                TextItalic
                    TextPlain "text"

Secondly, the TextMarkup(::Symbol,::String) constructor was functionally broken. Granted, this constructor isn't documented.

@tecosaur
Copy link
Owner

tecosaur commented Mar 9, 2025

Thanks for this work! I've recently started the long-promised rewrite though, so I'm afraid the code you've made this PR against will be gone in the next version of the package 😅

@kovariance
Copy link
Contributor Author

Thanks. I am going to close this then. Did not know about the rewrite. If you'd like, I'd love to contribute to the test suite. Writing unit tests is how I achieve zen.

@kovariance kovariance closed this May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants