Когда я запускаю следующий шаблон TBS (.docx), одинарные кавычки (') по-прежнему остаются в конечном выводе docx.
Если я удаляю их, специальные символы, такие как точка с запятой (;), разрушают шаблон, и не все элементы списка будут показаны.
Как я могу продолжать использовать специальные символы и избегать одинарных кавычек (') в моем документе?
some text here
1. [onshow;if [onload.missingFileEnabled;noerr] = ’1’; then ' Lorem ipsum
dolor sit amet, consectetur adipiscing elit.
• [test.x;block=tbs:listitem]
Aliquam a commodo lacus. Proin elit sapien, ultrices vel odio ac, ultricies ipsum ';magnet=w:p]
Соответствующие php коды:
// Create list data
$contentValues = array("missingFileEnabled" => "1", "testListItem1" => "Test; 1", "testListItem2" => "test 2", "testListItem3" => "test 3");
// Since multiple lists has to be supported, the list is converted into a list of list data.
$listItems = array();
foreach ($contentValues as $key => $value) {
if (strpos($key, 'ListItem') !== false && endsWith($key, 'Reservation') === false && endsWith($key, 'Description') === false) {
// echo "test<br>";
$keyParts = explode("ListItem", $key);
$listItems[$keyParts[0]][] = array("x" => str_replace("'", "’", $value));
}
}
// Then for each list, we merge the data
foreach ((array)$listItems as $listName => $list) {
$TBS->MergeBlock($listName, $list);
}
// Show the end file
$TBS->Show(OPENTBS_DOWNLOAD, $output_file_name);