Oct. 11th, 2012

kimira: (Default)
After writing an entry on another dw account today, my annoyance at the useless whitespace dw inserts after embeds finally got to me and I investigated, figured out why it was in the code, figured out how to more properly address the problem that code was written to address, and coded a successful patch. Had to delete two lines of code from dw/cgi-bin/LJ/EmbedModule.pm, and add a bit of style CSS to dw/htdocs/tools/embedcontent.bml. Pretty easy! Finding/figuring out the identity of embedcontent.bml was the main difficult part. (I know I needed whatever generated the html for the dw wrapper iframes, but had to figure out what that was.) So since this is not yet actually a bug, I submitted it to suggestions, and hopefully it will be made a bug and then I can submit my patch for it. :)

So now I'm kind of thinking about embeds again, which brings me back to my One True Bug, video embeds in comments. Have returned to CleanHTML.pm, and this time was able to confirm that it IS the problem/solution. The function clean_comment is what I need to fix. I tested this by commenting out the if loop on line 1591, as well as the word break code that was inside that loop, and just having clean_comment send the return 0; instead. And doing that (so, making clean_comment do none of its usual comment-cleaning), I successfully got a video embed to show up. So, COOL, I know that clean_comment is the problem, but figuring out a solution is still an issue. I tried changing all the options being sent to the clean function inside clean_comment to match the ones the clean_event function uses, thinking that maybe that's the function for entries? But, I don't actually know this for sure, having not checked into what's being called by whatever processes entries. Anyway, that didn't work, but that could be due to many things. The <wbr /> word breaks are still an issue, as they were before. Do we really NEED work breaks inserted in comments? Actually, now noticing that clean_event has those darned word breaks too, and since they botch long tags, probably not something that is in whatever's cleaning the entries? Anywho. I DID GET A VIDEO TO SHOW UP IN A COMMENT. GO ME. NOW JUST MUST MAKE SURE THAT ONLY WHITELISTED VIDEOS SHOW UP and not, you know, all manner of malicious/disallowed things, ha.


In other, non-dw coding news, I put my first JavaScript Greasemonkey script up the other day: Restore tumblr tags to sidebar

I am still pretty new to JavaScript, and now there are better (imo) scripts out there to solve the same problem, BUT!! I tackled a problem and managed to solve it to my satisfaction, as well as the satisfaction of 2,384 (!!!) people! I was pretty happy to make something that so many people used or at least tried out. So that was pretty cool.
kimira: (Default)
I FIGURED OUT CLEAN_COMMENT FOR VIDEO EMBEDS!!! OMG!!

added "object embed iframe" to the list for comment_all

added
    'noexpandembedded' => $opts->{'noexpandembedded'} ? 1 : 0,
    'transform_embed_nocheck' => $opts->{'transform_embed_nocheck'} ? 1 : 0,
    'transform_embed_wmode' => $opts->{'transform_embed_wmode'},
    rewrite_embed_param => $opts->{rewrite_embed_param} ? 1 : 0,
to the clean call inside clean_comment

didn't actually have to change wordlength at all!!

omg

now I just have to generate a patch and submit a pull or push or whatever request on github, omg

eta: did that, waiting for it to be pulled or whatnot!

November 2012

S M T W T F S
    123
45678910
1112 131415 1617
18192021222324
252627282930 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 6th, 2025 09:22 am
Powered by Dreamwidth Studios