A bare bones front-end for knockout designed for maximum compatibility with "obsolete" browsers
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

Code.php 536B

il y a 3 ans
12345678910111213141516171819202122232425
  1. <?php
  2. namespace App\BbCode\Tag;
  3. use Knockout\BbCode\Tag\TagInterface;
  4. use Knockout\BbCode\Tokenizer\Tag as TokenTag;
  5. class Code implements TagInterface
  6. {
  7. public function format(TokenTag $tokenTag): string
  8. {
  9. return sprintf('<pre>%s</pre>', htmlentities($tokenTag->getText()));
  10. }
  11. public function getName(): string
  12. {
  13. return 'code';
  14. }
  15. public function getOriginalText(TokenTag $tokenTag): string
  16. {
  17. return "[{$this->getName()}]{$tokenTag->getText()}[/{$this->getName()}";
  18. }
  19. }