Skip to main content
alexk64105558
Participant
Dec 23, 2017 3:03 AM UTC
Question

Prevent DW from adding spaces in php snippet

For some reason DW 2017, ads spaces around double quotes:

Before Applying Source Code Format:

<a href="<?php echo Url("blog/");?>" class="text"> Blog</a>

and  after:

<a href="<?php echo Url(" blog/ ");?>" class="text">Blog</a>

notice the extra white space within url function.

    This topic is closed to new replies. Start a new post to keep the conversation going.

    1 reply

    B i r n o u
    Legend
    Dec 23, 2017 4:10 AM UTC

    yes it's a kind of bug... but it is because the core hosting format is HTML... and you have 'sort' of nested double quoted (path string inside the attribute value)... replace the URL quoting by a simple quote, and that wont generate extra space

    <a href="<?php echo Url('blog/');?>" class="text"> Blog</a>

    Translate