aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/includes/MarkdownTest.php
Commit message (Collapse)AuthorAgeFilesLines
* Change config used by Markdown tests to reflect actual use.Harald Eilertsen2024-10-121-10/+23
| | | | | | | This makes the configuration used align better with how it is being used in the mdpost addon. This also reveals some issues that are less than ideal for Markdown posts. The relevant test cases have been adjusted to pass with the new config, but have been commented.
* markdown: Don't link URLs in code blocks.Harald Eilertsen2024-09-301-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When passing a content throught the `markdown_to_bb` function to convert any markdown in the content, any recognized URLs in the content would be converted to BBCode links as a post processing step after the main conversion. After commit a1ccacb825edac6ae36e5db4f62ebfe7aeaebe9f this did no longer consider content within code blocks, and would thus convert them as to BBCode links. Example: The following content [code] example url: https://example.com [/code] Would be converted to [code] example url: [url=https://example.com]https://example.com[/url] [/code] Prior to commit a1ccacb825edac6ae36e5db4f62ebfe7aeaebe9f, code blocks would be protected, so this would not happen. This patch removes the post processing step for converting plain URLs to links completely from this routine. This functionality is in any case covered in the actual BBCode parser where it belongs. This will have some other side effects as well, such as images and links created using Markdown, will not be converted to [zmg] or [zrl] tags where that would be done automatically before. If you intend to use a [zrl] or [zmg] tag, you now need to do so explicitly.
* Upgrade test framework to PHPUnit 10.5Harald Eilertsen2024-05-271-2/+2
|
* Support code blocks with language in markdown and html.Harald Eilertsen2024-02-081-0/+4
|
* Fix: Preserve hard linebreaks from markdown and htmlHarald Eilertsen2024-02-071-0/+8
|
* Fix: Keep indentation in html and md code blocks.Harald Eilertsen2024-02-071-0/+4
| | | | | | | Moves the logic for unwrapping broken lines in html (and Markdown) to the node processing, instead of doing it over the full html content. This allows us to skip if for code blocks (aka `<code>` elements within `<pre>` elements).
* Fix convert code blocs from markdown/html to bbcodeHarald Eilertsen2024-02-061-0/+8
|
* Fix image with alt text for html/md to bbcodeHarald Eilertsen2024-02-061-0/+4
|
* Add some tests for markdown to bbcode conversion.Harald Eilertsen2024-02-061-0/+37
|
* Clean up markdowntest and fix bb to markdown test.Harald Eilertsen2024-02-061-41/+25
|
* Unit tests: Update Markdown tests to reflect that it works.Harald Eilertsen2023-06-141-2/+2
|
* a possible fix for the nested list testMario2021-09-291-2/+2
|
* fix markdown testMario2020-01-091-2/+2
|
* fix another markdown testMario Vavti2018-10-301-1/+1
|
* fix markdown testsMario Vavti2018-10-301-12/+6
|
* fix html2markdown() and re-enable previously failing testsMario Vavti2018-10-301-4/+4
|
* fix phpunit error with html2markdown test and temporary disable failing ↵git-marijus2018-10-131-4/+8
| | | | markdown test in connection with **bold** and _italic_ (it is not clear why they fail and the code appears to work as expected)
* :hammer::white_check_mark: Add html2markdown unit tests.Klaus Weidenbach2017-05-271-0/+149
A tiny refactoring to make HTML 2 markdown conversion testable. Add some unit tests to check the behavior of the now used HTML2Markdown library. There are some differences compared to the old pixel418/markdownify library.