Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Disable the Markdown integration of images
Komic
New
Hi !
As my title explicitly suggests, I'm currently trying to disable integrated images on a forum using Markdown. Do you folks know a tweak to accomplish that ?
Thanks for your work both here and on Vanilla !
0
Comments
well note the markdown supports html.
In vanilla markdown if filter into html then filtered into htmLawed. So one way to achieve this is to remove html img tag from htmLawed
in plugins/HtmLawed/class.htmlawed.plugin.php
under
public function Format($Html) {
$Config
there is a line for'elements'
add to the end of that long string-img
Unfortunately it is not really set up ideal for updating. So you have to remember to re add it when you update.
Another idea is to remove it as a post filter.
The Markdown flavour is probably going change though and may use a different engine. However I suspect they will still keep this version of markdown as an option.
grep is your friend.
OK, got it, it works, images aren't displayed anymore.
Is there a way to disable entirely the interpretation of the "! [] ()" thing, and not simply its result ?
Thanks !
do you mean remove the image option in buttonbar.
in ButtonBar/views/buttonbar.php
// echo '<span class="ButtonWrap"><span>image</span></span>';
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
or you could look in buttonbar.js
and add around here
https://github.com/vanilla/vanilla/blob/2.1/plugins/ButtonBar/js/buttonbar.js#L332
ButtonBar.DisableButton(ButtonBarObj, 'image');
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Already done !
I mean that if you type the markdown thing for images, it's still interpreted !
I thought you said it was stripped. Are you saying it is escaping angle brackets?
grep is your friend.
I just tried and it work perfectly you should get nothing. Don't forget to also do it for
FormatRssHtmlCustom
section too.grep is your friend.
No, the images are gone (thanks again, of course that's a big start !), but there's simply nothing. At first I wanted to totally disable the interpretation of the
![]()
, to display it as text, just as the users type it.You never specified this.
You save people time trying to help you with what you want, by being clear and to the point.
Besides it is not really a start becuase these are two different things.
ATM there isn't an easy way yo do this, without modding the core, which is bad.
You could pre filter with a plugin maybe use html special chars to prevent it from being parsed.
You could also pre-load your own version of
Gdn_Format
adding your own formatter.Why would you wan to retain
![]()
? anyway. Do you want just links? maybe post-parsing img tags is the way to go.Anyway you need some programming knowledge to do it.
grep is your friend.
Well, IMO remove and disable are two separate things.
Thanks anyway, I'll use the first method !
Cool