Highlighted

Heredoc and Adobe Dreamweaver 2019 CC vol.2

New Here ,
Oct 15, 2019

Copy link to clipboard

Copied

Hi to all!

 

I'm writing this as a follow-up to my previous thread on the topic (Heredoc and Adobe Dreamweaver 2019 CC) that got lost during the forum's migration to the new platform.

 

So the last important reply there was made from @Paul-M , "promising" to have a look at my problem and maybe come up with a solution! So Paul did you have a chance to maybe take a look on this?

Views

320

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Heredoc and Adobe Dreamweaver 2019 CC vol.2

New Here ,
Oct 15, 2019

Copy link to clipboard

Copied

Hi to all!

 

I'm writing this as a follow-up to my previous thread on the topic (Heredoc and Adobe Dreamweaver 2019 CC) that got lost during the forum's migration to the new platform.

 

So the last important reply there was made from @Paul-M , "promising" to have a look at my problem and maybe come up with a solution! So Paul did you have a chance to maybe take a look on this?

Views

321

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 15, 2019 0
Adobe Community Professional ,
Oct 16, 2019

Copy link to clipboard

Copied

Can you send a a few code snippet examples please

Paul-M, ACP

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 16, 2019 0
New Here ,
Oct 17, 2019

Copy link to clipboard

Copied

In Dreamweaver CS 5.5, after putting the appropriate code in C:>Program Files>Adobe>Adobe Dreamweaver CC 2015>Configuration>CodeColoring>PHP.xml, you could get HTML code inside a PHP Heredoc parsed (and colored) as HTML. Ie the image below:

HTML parsed in Heredoc (DW CS5.5).JPG

 

In Dreamweaver CC 2019, HTML in PHP Heredoc is parsed as simple text, and only PHP vars are parsed (and colored) appropriately. Ie the image below (see how HTML is just in yelow and vars inside the curly brackets are colored as PHP):

HTML parsing in Heredoc.PNG

 

Whereas normal HTML is colored differently:

HTML parsing normally.PNG

 

The code sample shown in the two version of DW is the following:

 

 

		// In case of only one option, the interface sends an object instead of an array
		if (is_object($group->optionList)) {
			// So first check if the option is valid, otherwise skip it
			if (!isset($group->optionList->optionTranslations) or $group->optionList->optionTranslations == '~empty_key~' or preg_match('/_no_property$/', $group->optionList->optionName)) {
				continue;
			}

			// And then convert the object into an array
			$group->optionList = array(
				$group->optionList
			);
		}

		$translated = translate($group->selectName);

		echo <<<END
          <div class="card">
            <div class="card-header" id="heading{$group->selectId}">
              <h2 class="mb-0">
                <button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#collapse{$group->selectId}" aria-expanded="false" aria-controls="collapse{$group->selectId}">{$translated}</button>
                <div class="spinner-border spinner-border-sm text-secondary" role="status"><span class="sr-only">Loading...</span></div>
                <i class="fa fa-code pull-right" data-toggle="popover" data-container="body" data-placement="left" data-html="true" data-content="{$tooltip}"></i>
              </h2>
            </div>
            <div class="collapse" id="collapse{$group->selectId}" data-parent="#apiResponse" aria-labelledby="heading{$group->selectId}">
              <div class="card-body">
                <div class="list-group list-group-flush">
END;

		foreach ($group->optionList as $option) {
			// Translation texts consisting of...
			switch (gettype($option->optionTranslations)) {

 

 

Fun fact I realized after pasting my code in the code box above: Even this code box of this WYSIWYG editor parses the HTML code inside the PHP Heredoc correctly, and DW CC 2019 cannot!

 

EDIT: Once I submitted my Reply, the code in the code box got colored in black, but while in Edit mode, it gets colored correctly:Edit box in Adobe forum.PNG

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 17, 2019 0
Adobe Community Professional ,
Oct 18, 2019

Copy link to clipboard

Copied

I coldn't find a solution for this - not possible to get html code colouring inside heredoc as far as I could see, as you already pointed out, its treated like a string and only vars are coloured

Paul-M, ACP

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 18, 2019 0
Adobe Community Professional ,
Oct 18, 2019

Copy link to clipboard

Copied

see screenshot:

heredoc.png

 

I'm assuming you'll probably aware of thhis, in code theme

 

.cm-m-clike.cm-string {
color: #FFF;
}

 

It doesn't solve your problem of wanting html code colouring inside heredoc though ....

Paul-M, ACP

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 18, 2019 0
Engaged ,
May 04, 2020

Copy link to clipboard

Copied

My workaround currently is just comment out the heredoc tags, which re-enables the syntax highlighting and then re-enabling when done.  A PITA, but it works.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 04, 2020 0