Skip to content

Commit

Permalink
Merge branch '2.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
colinodell committed Dec 7, 2024
2 parents bbef330 + c95ad24 commit cb026a5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ echo $converter->convert('# Hello World!');

Please note that only UTF-8 and ASCII encodings are supported. If your Markdown uses a different encoding please convert it to UTF-8 before running it through this library.

🔒 If you will be parsing untrusted input from users, please consider setting the `html_input` and `allow_unsafe_links` options per the example above. See <https://commonmark.thephpleague.com/security/> for more details. If you also do choose to allow raw HTML input from untrusted users, consider using a library (like [HTML Purifier](https://github.com/ezyang/htmlpurifier)) to provide additional HTML filtering.
> [!CAUTION]
> If you will be parsing untrusted input from users, please consider setting the `html_input` and `allow_unsafe_links` options per the example above. See <https://commonmark.thephpleague.com/security/> for more details. If you also do choose to allow raw HTML input from untrusted users, consider using a library (like [HTML Purifier](https://github.com/ezyang/htmlpurifier)) to provide additional HTML filtering.
## 📓 Documentation

Expand Down Expand Up @@ -163,11 +164,13 @@ $ ./tests/benchmark/benchmark.php

## 👥 Credits & Acknowledgements

- [Colin O'Dell][@colinodell]
- [John MacFarlane][@jgm]
- [All Contributors]
This code was originally based on the [CommonMark JS reference implementation][commonmark.js] which is written, maintained, and copyrighted by [John MacFarlane]. This project simply wouldn't exist without his work.

This code is partially based on the [CommonMark JS reference implementation][commonmark.js] which is written, maintained and copyrighted by [John MacFarlane]. This project simply wouldn't exist without his work.
And a huge thanks to all of our amazing contributors:

<a href="https://github.com/thephpleague/commonmark/graphs/contributors">
<img src="https://contrib.rocks/image?repo=thephpleague/commonmark" />
</a>

### Sponsors

Expand Down
12 changes: 7 additions & 5 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
colorator (1.1.0)
concurrent-ruby (1.2.2)
concurrent-ruby (1.2.3)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
Expand Down Expand Up @@ -37,7 +37,7 @@ GEM
http_parser.rb (0.8.0)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
jekyll (4.3.3)
jekyll (4.3.4)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
Expand Down Expand Up @@ -81,7 +81,8 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.6)
rexml (3.2.9)
strscan
rouge (3.30.0)
ruby2_keywords (0.0.5)
safe_yaml (1.0.5)
Expand All @@ -90,6 +91,7 @@ GEM
sawyer (0.9.2)
addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3)
strscan (3.1.0)
terminal-table (2.0.0)
unicode-display_width (~> 1.1, >= 1.1.1)
unicode-display_width (1.8.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public function getDelimiterUse(DelimiterInterface $opener, DelimiterInterface $
return 0;
}

return \min($opener->getLength(), $closer->getLength());
// $opener and $closer are the same length so we just return one of them
return $opener->getLength();
}

public function process(AbstractStringContainer $opener, AbstractStringContainer $closer, int $delimiterUse): void
Expand Down
1 change: 1 addition & 0 deletions src/Normalizer/SlugNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public function normalize(string $text, array $context = []): string
$slug = \mb_substr($slug, 0, $length, 'UTF-8');
}

// @phpstan-ignore-next-line Because it thinks mb_substr() returns false on PHP 7.4
return $slug;
}
}

0 comments on commit cb026a5

Please sign in to comment.