Skip to content

Commit bdad3cd

Browse files
committed
code_samples_usage.php: remove quotes around glue value
1 parent e16019a commit bdad3cd

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tools/code_samples/code_samples_usage.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,12 @@ function getBlockContents(array $block): array
189189
}
190190
$sample = array_slice($includedFilesLines[$includedFilePath], (int)$matches['start'][$matchIndex], (int)$matches['end'][$matchIndex] - (int)$matches['start'][$matchIndex]);
191191
}
192-
if ('include_code' === $matches['function'][$matchIndex] && !empty($matches['indent_level'][$matchIndex])) {
193-
$matches['indent_level'][$matchIndex] = str_repeat(' ', $matches['indent_level'][$matchIndex]);
192+
if (!empty($matches['indent_level'][$matchIndex])) {
193+
if ('include_code' === $matches['function'][$matchIndex]) {
194+
$matches['indent_level'][$matchIndex] = str_repeat(' ', $matches['indent_level'][$matchIndex]);
195+
} elseif ('include_file' === $matches['function'][$matchIndex]) {
196+
$matches['indent_level'][$matchIndex] = trim($matches['indent_level'][$matchIndex], '"\'');
197+
}
194198
}
195199
if ('True' === $matches['remove_indent'][$matchIndex]) {
196200
$removable = null;

0 commit comments

Comments
 (0)