| Conditions | 1 |
| Paths | 1 |
| Total Lines | 24 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | public function parse(InlineParserContext $inlineContext): bool |
||
| 25 | { |
||
| 26 | $route = $inlineContext->getFullMatch(); |
||
| 27 | |||
| 28 | // Push the cursor to the lenght of the full match. |
||
| 29 | $inlineContext->getCursor()->advanceBy(mb_strlen($route)); |
||
| 30 | |||
| 31 | $content = "{$inlineContext->getMatches()[1]}#{$inlineContext->getMatches()[5]}"; |
||
| 32 | |||
| 33 | |||
| 34 | $inlineContext->getContainer() |
||
| 35 | ->appendChild(new GithubPullRequest( |
||
| 36 | $content, |
||
| 37 | [ |
||
| 38 | 'attributes' => [ |
||
| 39 | 'href' => $route, |
||
| 40 | 'target' => '_blank', |
||
| 41 | 'class' => 'link link-hover link-primary', |
||
| 42 | 'title' => $content |
||
| 43 | ] |
||
| 44 | ] |
||
| 45 | )); |
||
| 46 | |||
| 47 | return true; |
||
| 48 | } |
||
| 50 |