Skip to content

Commit

Permalink
Merge pull request #4235 from Roardom/bbcode-hr
Browse files Browse the repository at this point in the history
(Add) `[hr]` bbcode tag for horizontal rule
  • Loading branch information
HDVinnie authored Oct 17, 2024
2 parents 2c869b1 + 4857fcb commit 94e3fc5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/Helpers/Bbcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ public function parse(?string $source, bool $replaceLineBreaks = true): string
{
// Replace all void elements since they don't have closing tags
$source = str_replace('[*]', '<li>', (string) $source);
$source = str_replace('[hr]', '<hr>', $source);
$source = preg_replace_callback(
'/\[url](.*?)\[\/url]/i',
fn ($matches) => '<a href="'.$this->sanitizeUrl($matches[1]).'">'.$this->sanitizeUrl($matches[1]).'</a>',
Expand Down
2 changes: 1 addition & 1 deletion resources/sass/components/_bbcode-rendered.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
overflow: hidden;
background: transparent;
border-bottom: 1px solid var(--bbcode-rendered-border-muted);
height: 0.25em;
height: 1px;
padding: 0;
margin: 24px 0;
background-color: var(--bbcode-rendered-border-default);
Expand Down

0 comments on commit 94e3fc5

Please sign in to comment.