Skip to content

Commit

Permalink
Still render links when block tags are disabled
Browse files Browse the repository at this point in the history
Fixes #225
  • Loading branch information
gocom committed Jun 7, 2024
1 parent 158ac83 commit 0554cb1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.textile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Here's a summary of changes in each release. The list doesn't include some small

h2. Version 4.2.0 - upcoming

* Links are still rendered when block tags are disabled (closes "#225":https://github.com/textile/php-textile/issues/225).

h2. "Version 4.1.0 - 2024/01/02":https://github.com/textile/php-textile/releases/tag/v4.1.0

* Support @:@ and @!@ characters in CSS class names (closes "#224":https://github.com/textile/php-textile/issues/224).
Expand Down
3 changes: 3 additions & 0 deletions src/Netcarver/Textile/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -1972,6 +1972,9 @@ public function parse($text)
// Inline markup (em, strong, sup, sub, del etc).
$text = $this->spans($text);

// Generate links.
$text = $this->links($text);

// Glyph level substitutions (mainly typographic -- " & ' => curly quotes, -- => em-dash etc.
$text = $this->glyphs($text);
}
Expand Down
13 changes: 13 additions & 0 deletions test/fixtures/issue-225.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Disabling block tags should not disable links:
setup:
- setBlockTags: false
input : |
"Link":https://example.com
expect : |
<a href="https://example.com">Link</a>
Link output should be similar with block tags enabled:
input : |
"Link":https://example.com
expect : |
<p><a href="https://example.com">Link</a></p>

0 comments on commit 0554cb1

Please sign in to comment.