Skip to content
Snippets Groups Projects

Resolve #3507447 "Markup that breaks"

1 unresolved thread

Closes #3507447

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
52 $result = $hl->highlightAuto($node->textContent);
53 }
54 elseif ($mode === 'manual' && $regex) {
55 preg_match($regex, $document->saveHTML($node), $matches);
56 if (isset($matches[1])) {
57 $result = $hl->highlight($matches[1], $node->textContent);
46 if ($mode === 'auto') {
47 $hl->setAutodetectLanguages(explode(' ', trim($config->get('auto_languages') ?? 'php javascript')));
48 }
49
50 $document = Html::load($html);
51 $xpath = new \DOMXPath($document);
52 $modified = FALSE;
53
54 /** @var \DOMElement $node */
55 foreach ($xpath->query('//code[not(ancestor::code)]') as $node) {
  • Hannes Kirsman added 1 commit

    added 1 commit

    • e1a96300 - Make the change minimal, keeping tests basically the same.

    Compare with previous version

  • Please register or sign in to reply
    Loading