-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
added optional options to noprocess #2954
Conversation
theres some bugs found in discord currently testing |
Test cases above all working as intended |
be great if you could add these to the test suite @ricardo118 |
Also will need some updates to learn to show how it can be used with options |
Signed-off-by: Andy Miller <rhuk@mac.com>
Signed-off-by: Andy Miller <rhuk@mac.com>
I added some tests, and used those to confirm the functionality is good. perhaps you can use these for future reference. |
I needed to remove this "automatic extraction of links attributes" so I removed all of them in the configuration. Un fortunately, as there is no attributes, the configuration element is no more an array but "null" and I got Exception "in_array() expects parameter 2 to be array, null given" ( // Loop through actions for the image and call them.
foreach ($actions as $attrib => $value) {
if (!in_array($attrib, $skip)) {
$key = $attrib;
if (in_array($attrib, $valid_attributes, true)) { // <---- this one is the 131
// support both class and classes.
if ($attrib === 'classes') {
$attrib = 'class';
}
$excerpt['element']['attributes'][$attrib] = str_replace(',', ' ', $value);
unset($actions[$key]);
}
}
} My workaround without changing the code is to add a random string as a valid attribute in the hope no website will use it as valid attribute (but as I choose it randomly, chances are really tiny). To fix it in the code, I changed the 117th line as follows (adding the $valid_attributes = $grav['config']->get('system.pages.markdown.valid_link_attributes') ?: [] ; (I was going to submit a pull request with this change but did not find the Excerps.php file in develop or 1.7 branches so I don't know how to fix it in the github code). |
@ricardo118 Can you take a look? |
ya will do |
i just tested this, and while yes what you say does happen, i fixed the error without having any issues by simply setting the config to However, admin saves it as null, so i believe the check suggested here is valid. Pushed a change here 2813934 |
This enables the option &noprocess to be expanded to &noprocess=id,hl
Example:
[PlayStore](https://play.google.com/store/apps/details?id=org.jitsi.meet&hl=de&target=_blank&noprocess)
Current result link:
https://play.google.com/store/apps/details?id=org.jitsi.meet&hl=de&target=_blank
- not opening in new tabThis will work as intended by not processing the
id
, however the target also gets no processed.Using
[PlayStore](https://play.google.com/store/apps/details?id=org.jitsi.meet&hl=de&target=_blank&noprocess=id)
Will skip the
id
processing, and still process the target. Resulting in a better end result link.New result link:
https://play.google.com/store/apps/details?id=org.jitsi.meet&hl=de
- opening in new tab successfullyThis is in reference to the following issues:
#2839 - FIXED
#2882
https://discordapp.com/channels/501836936584101899/501854266873348112/729728029063905345