Skip to content

Commit

Permalink
Expose the EmphasisParser::determineCanOpenOrClose() method for other…
Browse files Browse the repository at this point in the history
… emphasis-based inlines to use
  • Loading branch information
colinodell committed Apr 20, 2019
1 parent 307748c commit 45e0b86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Updates should follow the [Keep a CHANGELOG](https://keepachangelog.com/) princi
- Replaced its `collapseTextNodes()` method with the new `mergeChildNodes()` method
- `DelimiterStack::findEarliest()` changed from `public` to `private`
- Changed `InlineParserEngine` to be `final` and changed its `protected` methods to `private`
- Exposed `EmphasisParser::determineCanOpenOrClose()` as a `public static` method (used to be `private`)

### Removed

Expand Down
4 changes: 2 additions & 2 deletions src/Inline/Parser/EmphasisParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function parse(InlineParserContext $inlineContext): bool
$charAfter = "\n";
}

list($canOpen, $canClose) = $this->determineCanOpenOrClose($charBefore, $charAfter, $character);
list($canOpen, $canClose) = self::determineCanOpenOrClose($charBefore, $charAfter, $character);

$node = new Text($cursor->getPreviousText(), [
'delim' => true,
Expand All @@ -124,7 +124,7 @@ public function parse(InlineParserContext $inlineContext): bool
*
* @return bool[]
*/
private function determineCanOpenOrClose(string $charBefore, string $charAfter, string $character)
public static function determineCanOpenOrClose(string $charBefore, string $charAfter, string $character)
{
$afterIsWhitespace = \preg_match(RegexHelper::REGEX_UNICODE_WHITESPACE_CHAR, $charAfter);
$afterIsPunctuation = \preg_match(RegexHelper::REGEX_PUNCTUATION, $charAfter);
Expand Down

0 comments on commit 45e0b86

Please sign in to comment.