formulahendry / vscode-auto-rename-tag

Automatically rename paired HTML/XML tag
https://marketplace.visualstudio.com/items?itemName=formulahendry.auto-rename-tag
MIT License
259 stars 36 forks source link

Adding tag label to "<" in if statement #609

Open Spleeding1 opened 2 years ago

Spleeding1 commented 2 years ago

For some reason the closing </b> is messing with the < less than in the if statement. I switched it to if ($cart_item['quantity'] > $square_quantity) { to resolve it.

What it is supposed to look like:

if ($square_quantity < $cart_item['quantity']) {
    wc_clear_notices();
    wc_add_notice( __( '<p>We do not have enough <b>'.$cart_item['data']->name.'</b> in stock.
                                        Your cart has been updated with the available quantity.</p>', 'woocommerce' ), 'error' );
    $woocommerce->cart->set_quantity($cart_item_key, $square_quantity);
            }

What I get:

if ($square_quantity <b $cart_item['quantity']) {
    wc_clear_notices();
    wc_add_notice( __( '<p>We do not have enough <b>'.$cart_item['data']->name.'</b> in stock.
                                        Your cart has been updated with the available quantity.</p>', 'woocommerce' ), 'error' );
    $woocommerce->cart->set_quantity($cart_item_key, $square_quantity);
            }

or

if ($square_quantity < $cart_item['quantity']) {
    wc_clear_notices();
    wc_add_notice( __( '<p>We do not have enough <b>'.$cart_item['data']->name.'</> in stock.
                                        Your cart has been updated with the available quantity.</p>', 'woocommerce' ), 'error' );
    $woocommerce->cart->set_quantity($cart_item_key, $square_quantity);
            }
head-gardener commented 2 years ago

What are the steps to replicate? I don't seem to have any problems with this code

Spleeding1 commented 2 years ago
  1. Create new .php file with opening <?php tag.
  2. Begin typing if statement.
  3. Issue will appear when closing </b> tag is reached.

or

  1. Copy/Paste if statement into new .php file with opening <?php tag.
  2. Change b in closing </b> tag to p.

https://user-images.githubusercontent.com/34792693/178503497-650e6d21-bf1a-4bbd-a4ce-e1c8a22fee60.mov

head-gardener commented 2 years ago

Yeah, i see it now. Seems like tags separated by a comparison sign will not connect:

<p> > </p>
or
'<p>' + (a<b? 'helo' : 'world') + '</p>'

A bug!