Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Prevent DW from adding spaces in php snippet

New Here ,
Dec 22, 2017 Dec 22, 2017

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.

251
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 22, 2017 Dec 22, 2017
LATEST

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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines