Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Extremely long lines followed by HTML breaks highlighting #362

@andreazorzi

Description

@andreazorzi

Prerequisites

Description

The syntax of some parts of php code is not highlighted correctly, specifically it highlights the html code contained in the string and not the string itself

Steps to Reproduce

  1. open a blank php file and paste the following code:
<?php

    echo '
        <td id="card'.$row2["ID"].'" data-open="card" data-cardid="'.$row2["ID"].'" class="card editable" style="width: '.(100/$row2["Tipo"]).'%; '.($i == $result2->num_rows - 1 ? "margin-bottom: 0px !important;" : "").' '.($row2["Foto"] == 1 ? '' : 'min-height: auto !important;').'">
            <table style="'.$stile_card_contenuto.' '.($row2["Foto"] == 1 ? '' : 'background-color: transparent !important;').'">
                '.($row2["Foto"] == 1 ? '
                <tr>
                    <td style="background-image: url('.$row2["UrlPhoto"].'); background-position: center center; '.$stile_card.'">

                    </td>
                </tr>
                ' : '').'

                '.($row2["Testo"] != "" ? '
                <tr>
                    <td style="'.$stile_text.' '.($row2["Foto"] == 1 ? '' : 'text-align: center !important; font-size: 22px !important;').'">
                        <span class="title" style="'.$stile_titolo_fascia.'">'.$row2["Titolo"].'</span><br>
                        '.str_replace("&nbsp;", " ", $row2["Testo"]).'
                    </td>
                </tr>
                ' : '').'

                '.($row2["Bottone"] == 1 ? '
                <tr>
                    <td style="padding: 0px; height: 31px; '.($row2["Foto"] == 1 ? 'text-align: right;' : 'text-align: center !important;').'">
                        <div style="padding: 15px; padding-left: 0px; padding-top: 10px;">
                            <a href="'.str_replace("{{keyword}}", $id_newsletter, attachUtm($riga["Utm"], $row2["UrlBottone".$url_lang], $riga["Lingua"])).'" class="inbox_button" style="'.$stile_card_bottone.' '.($row2["Foto"] == 1 ? 'text-align: right;' : 'font-size: 20px !important;').'">
                                '.$row2["TestoBottone"].'
                            </a>
                        </div>
                    </td>
                </tr>
                ' : '').'
            </table>
        </td>
    ';

?>

sorry if the code is not displayed correctly, I also upload it as an attached file along with the screenshot

  1. in the fifth line of the code the syntax highlighting of the string is incorrect

Expected behavior:
the color of the fifth line should be green because it's part of a string

Actual behavior:
the string in the fifth line highlight the html code contained in the string

Reproduces how often:
I tried several times and it happened 100% of the time

Versions

Atom : 1.38.1
Electron: 2.0.18
Chrome : 61.0.3163.100
Node : 8.9.3

Additional Information

screenshot

test.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions