-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple class selectors on same element in a PHP file #141
Comments
As far as I understand it (which might be quite limited), When using a Then, |
Hey. Sorry for the late response. You are right PHP is not yet supported and will be taken, as you already stated, as "any" instead of "html". However before we go any deeper into development, would you except to change variables within PHP as well? Something like: <?php
$some_class = "some-class"; to transform to e.g.: <?php
$some_class = "a";
|
No problems at all! In my opinion, it should at least fully work on the <?php
$some = "some-class";
$other = someAPICall() ? $some : "other-class";
include 'classes.php';
?>
/* needs to deeply parse the above php */
<div class="<?php echo $other; ?>"></div>
/* needs to parse the above php and the inline html */
<div class="<?php echo $some; ?> default-class"></div>
/* breaks the attributes array on both parse5 and htmlparser2 because of the
first opening " in php which is closing the html's class attribute declaration */
<div class="<?php echo "a-class", $bClass; ?>"></div>
/* needs to teach rcs-core to look at classes.php after this? */
<div class="<?php echo $aClassFromIncludedFile; ?>"></div>
I can't wrap my head around how to go through all this in a robust way, I probably need to understand better |
Ok so I think as first iteration it can be HTML inside PHP files only (I will work either later today, or on the weekend) and second iteration (if that works reliable) |
Great! So for first iteration, using html replacer works as expected: const php = rcs.replace.html(fs.readFileSync('./src/index.php', 'utf8')); Or here with html: ['.html', '.html', '.php'], So I think simply running a regex like this on the output to replace the commented out /(<!--\?php).*(\?-->)/gm But |
Any news on this? With Gulp 5: Before After |
When using
gulp-rcs
^3.0.0
andrcs-core
^3.6.5
with aPHP
document including elements with multiple class selectors, these element's classlists are not transformed.For example:
Transforms to:
If I change the
PHP
file to anHTML
file and keep the samegulp-rcs
config, everything goes as espected.Same example transforms to:
There doesn't seem to be anything related in the caveats list. Any hints on what is going on here?
The text was updated successfully, but these errors were encountered: