Guest User

Untitled

a guest
Jan 22nd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. $config = \HTMLPurifier_Config::createDefault();
  2. $config->set('HTML.DefinitionID', 'basecamp-trix-editor');
  3. $config->set('HTML.DefinitionRev', 1);
  4. $config->set('HTML.TidyLevel', 'none');
  5.  
  6. if ($def = $config->maybeGetRawHTMLDefinition()) {
  7.  
  8. $def->addElement('figure', 'Inline', 'Inline', 'Common');
  9. $def->addAttribute('figure', 'class', 'Text');
  10.  
  11. $def->addElement('figcaption', 'Inline', 'Inline', 'Common');
  12. $def->addAttribute('figcaption', 'class', 'Text');
  13. $def->addAttribute('figcaption', 'data-trix-placeholder', 'Text');
  14.  
  15. $def->addAttribute('a', 'rel', 'Text');
  16. $def->addAttribute('a', 'tabindex', 'Text');
  17. $def->addAttribute('a', 'contenteditable', 'Enum#true,false');
  18. $def->addAttribute('a', 'data-trix-attachment', 'Text');
  19. $def->addAttribute('a', 'data-trix-content-type', 'Text');
  20. $def->addAttribute('a', 'data-trix-id', 'Number');
  21.  
  22. $def->addElement('span', 'Block', 'Flow', 'Common');
  23. $def->addAttribute('span', 'data-trix-cursor-target', 'Enum#right,left');
  24. $def->addAttribute('span', 'data-trix-serialize', 'Enum#true,false');
  25.  
  26. $def->addAttribute('img', 'data-trix-mutable', 'Enum#true,false');
  27. $def->addAttribute('img', 'data-trix-store-key', 'Text');
  28. }
Add Comment
Please, Sign In to add comment