<?php function preserveAmpersandEscapeInOptionTagForFomanticUiDropdownWithPreserveHtmlFalse($v) { return str_replace('&', '&amp;', $v); } $in = 'A & B &'; // example of text to preserve $in .= ' ' . preserveAmpersandEscapeInOptionTagForFomanticUiDropdownWithPreserveHtmlFalse($in); // example of escaping the text to preserve it 1:1 echo $in . "\n"; $str = preg_replace('~&(?!\w+;)~', '&', $in); // done by browser when parsing/normalizing HTML echo $str . "\n"; $str = str_replace('&', '&', $in); // done by https://github.com/fomantic/Fomantic-UI/pull/3224/commits/0bc8f67dcb echo $str . "\n";
You have javascript disabled. You will not be able to edit any code.