@@ -148,24 +148,21 @@ discard block |
||
| 148 | 148 | { |
| 149 | 149 | //Manage the modifiers |
| 150 | 150 | $new_string_split[count($new_string_split) - 1] .= $str_split_unicode[$i]; //Apppend the modifier to the previous char |
| 151 | - } |
|
| 152 | - else |
|
| 151 | + } else |
|
| 153 | 152 | { |
| 154 | 153 | if ($codepoint == "200d") |
| 155 | 154 | { |
| 156 | 155 | //Manage the Zero Width Joiner |
| 157 | 156 | $new_string_split[count($new_string_split) - 1] .= $str_split_unicode[$i]; //Apppend the ZWJ to the previous char |
| 158 | 157 | $joiner = true; |
| 159 | - } |
|
| 160 | - else |
|
| 158 | + } else |
|
| 161 | 159 | { |
| 162 | 160 | if ($joiner) |
| 163 | 161 | { |
| 164 | 162 | //If previous one was a ZWJ |
| 165 | 163 | $new_string_split[count($new_string_split) - 1] .= $str_split_unicode[$i]; //Apppend to the previous char |
| 166 | 164 | $joiner = false; |
| 167 | - } |
|
| 168 | - else |
|
| 165 | + } else |
|
| 169 | 166 | { |
| 170 | 167 | $new_string_split[] = $str_split_unicode[$i]; //New char |
| 171 | 168 | } |
@@ -194,38 +191,31 @@ discard block |
||
| 194 | 191 | if ($char == $this->getEntityStartString($entity)) |
| 195 | 192 | { |
| 196 | 193 | return $char."\\".$char.$char; |
| 197 | - } |
|
| 198 | - else |
|
| 194 | + } else |
|
| 199 | 195 | { |
| 200 | 196 | return $char; |
| 201 | 197 | } |
| 202 | - } |
|
| 203 | - else |
|
| 198 | + } else |
|
| 204 | 199 | { |
| 205 | 200 | return $char; |
| 206 | 201 | } |
| 207 | - } |
|
| 208 | - else |
|
| 202 | + } else |
|
| 209 | 203 | { |
| 210 | 204 | if ($char == '*' || $char == '_' || $char == '[' || $char == '`') |
| 211 | 205 | { |
| 212 | 206 | return "\\".$char; |
| 213 | - } |
|
| 214 | - else |
|
| 207 | + } else |
|
| 215 | 208 | { |
| 216 | 209 | return $char; |
| 217 | 210 | } |
| 218 | 211 | } |
| 219 | - } |
|
| 220 | - else if ($this->style == 'HTML') |
|
| 212 | + } else if ($this->style == 'HTML') |
|
| 221 | 213 | { |
| 222 | 214 | return ($char == '<' ? '<' : ($char == '>' ? '>' : ($char == '&' ? '&' : $char))); |
| 223 | - } |
|
| 224 | - else if ($this->style == 'MarkdownV2') |
|
| 215 | + } else if ($this->style == 'MarkdownV2') |
|
| 225 | 216 | { |
| 226 | 217 | return (in_array($char, array('_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!', '\\')) ? '\\'.$char : $char); |
| 227 | - } |
|
| 228 | - else |
|
| 218 | + } else |
|
| 229 | 219 | { |
| 230 | 220 | return $char; |
| 231 | 221 | } |
@@ -272,8 +262,7 @@ discard block |
||
| 272 | 262 | break; |
| 273 | 263 | } |
| 274 | 264 | } |
| 275 | - } |
|
| 276 | - else if ($this->style == 'HTML') |
|
| 265 | + } else if ($this->style == 'HTML') |
|
| 277 | 266 | { |
| 278 | 267 | switch ($entity->type) |
| 279 | 268 | { |
@@ -327,8 +316,7 @@ discard block |
||
| 327 | 316 | break; |
| 328 | 317 | } |
| 329 | 318 | } |
| 330 | - } |
|
| 331 | - else if ($this->style == 'MarkdownV2') |
|
| 319 | + } else if ($this->style == 'MarkdownV2') |
|
| 332 | 320 | { |
| 333 | 321 | switch ($entity->type) |
| 334 | 322 | { |
@@ -378,8 +366,7 @@ discard block |
||
| 378 | 366 | break; |
| 379 | 367 | } |
| 380 | 368 | } |
| 381 | - } |
|
| 382 | - else |
|
| 369 | + } else |
|
| 383 | 370 | { |
| 384 | 371 | throw new Exception("Wrong style name"); |
| 385 | 372 | } |
@@ -450,8 +437,7 @@ discard block |
||
| 450 | 437 | break; |
| 451 | 438 | } |
| 452 | 439 | } |
| 453 | - } |
|
| 454 | - else if ($this->style == 'HTML') |
|
| 440 | + } else if ($this->style == 'HTML') |
|
| 455 | 441 | { |
| 456 | 442 | switch ($entity->type) |
| 457 | 443 | { |
@@ -501,8 +487,7 @@ discard block |
||
| 501 | 487 | break; |
| 502 | 488 | } |
| 503 | 489 | } |
| 504 | - } |
|
| 505 | - else if ($this->style == 'MarkdownV2') |
|
| 490 | + } else if ($this->style == 'MarkdownV2') |
|
| 506 | 491 | { |
| 507 | 492 | switch ($entity->type) |
| 508 | 493 | { |
@@ -552,8 +537,7 @@ discard block |
||
| 552 | 537 | break; |
| 553 | 538 | } |
| 554 | 539 | } |
| 555 | - } |
|
| 556 | - else |
|
| 540 | + } else |
|
| 557 | 541 | { |
| 558 | 542 | throw new Exception("Wrong style name"); |
| 559 | 543 | } |