File tree Expand file tree Collapse file tree 3 files changed +29
-1
lines changed
Expand file tree Collapse file tree 3 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -62,10 +62,11 @@ public function parseAudio($text)
6262 /**
6363 * Handles:
6464 * - Centre (centre).
65+ * - Right (right).
6566 */
6667 public function parseBlockSimple ($ text )
6768 {
68- foreach (['centre ' ] as $ tag ) {
69+ foreach (['centre ' , ' right ' ] as $ tag ) {
6970 $ text = preg_replace (
7071 "#\[ {$ tag }](.*?)\[/ {$ tag }\]#s " ,
7172 "[ {$ tag }: {$ this ->uid }] \\1[/ {$ tag }: {$ this ->uid }] " ,
Original file line number Diff line number Diff line change @@ -91,6 +91,14 @@ public function parseCentre($text)
9191 return $ text ;
9292 }
9393
94+ public function parseRight ($ text )
95+ {
96+ $ text = str_replace ("[right: {$ this ->uid }] " , "<div class='right'> " , $ text );
97+ $ text = str_replace ("[/right: {$ this ->uid }] " , '</div> ' , $ text );
98+
99+ return $ text ;
100+ }
101+
94102 public function parseCode ($ text )
95103 {
96104 return preg_replace (
@@ -372,6 +380,7 @@ public function toHTML()
372380 $ text = $ this ->parseAudio ($ text );
373381 $ text = $ this ->parseBold ($ text );
374382 $ text = $ this ->parseCentre ($ text );
383+ $ text = $ this ->parseRight ($ text );
375384 $ text = $ this ->parseInlineCode ($ text );
376385 $ text = $ this ->parseColour ($ text );
377386 $ text = $ this ->parseEmail ($ text );
Original file line number Diff line number Diff line change 9292 font-size : inherit ;
9393 }
9494
95+ .right {
96+ text-align : right ;
97+
98+ img ,
99+ iframe ,
100+ audio ,
101+ video ,
102+ .js-audio--player ,
103+ .imagemap {
104+ margin-left : auto ;
105+ margin-right : 0 ;
106+ }
107+
108+ .bbcode-spoilerbox {
109+ display : inline-block ;
110+ }
111+ }
112+
95113 .unordered {
96114 list-style-type : disc ;
97115 }
You can’t perform that action at this time.
0 commit comments