plugin-php
plugin-php copied to clipboard
___PSEUDO_INLINE_PLACEHOLDER___ added to EOD string
Prettier 2.7.1
PHP Plugin 0.19.1
# Options (if any):
printWidth: 120
Input:
const liftDataWithInlineRanges = <<<EOD
<?xml version="1.0" encoding="UTF-8" ?>
<?oxygen RNGSchema="lift.rng" type="xml"?>
<?blueprint schema="lift.rng"?>
<lift version="0.13" producer="LexiquePro.3.6">
...
Output:
const liftDataWithInlineRanges = <<<EOD
<?xml version="1.0" encoding="UTF-8" ?>
___PSEUDO_INLINE_PLACEHOLDER___<?oxygen RNGSchema="lift.rng" type="xml"?>
___PSEUDO_INLINE_PLACEHOLDER___<?blueprint schema="lift.rng"?>
<lift version="0.13" producer="LexiquePro.3.6">
...
Expected behavior:
No ___PSEUDO_INLINE_PLACEHOLDER___
strings getting added to the output.
Original code: https://github.com/sillsdev/web-languageforge/blob/e32600219a99030914cad7d4a9a430058800a4ea/test/php/model/languageforge/lexicon/Import/LiftImportTest.php#L1623
It looks like it was designed to handle some cases where inline or short tags have only a newline between them:
https://github.com/prettier/plugin-php/blob/9917045bab9723056a813879eb75dc092bb6f33b/src/parser.js#L11-L12
I don't know why it's leaking into your heredoc though, or the best way to remove it.
My current workaround was to add a space (
) at the beginning of the two problematic lines.