Permalink
Browse files

Fix a bug in snuownd's raw HTML handling.

  • Loading branch information...
1 parent 502b64a commit 0a56b0d5415d719a5e442c1e1f2a049b9794165d @gamefreak committed May 2, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/reddit_enhancement_suite.user.js
@@ -7274,7 +7274,7 @@ if(body)out.s+=body.s;out.s+="</tbody></table>\n"},table_row:function table_row(
text.s;if(flags&MKD_TABLE_HEADER)out.s+="</th>\n";else out.s+="</td>\n"},autolink:function autolink(out,link,type,options){var offset=0;if(!link||!link.s.length)return 0;if((options.flags&HTML_SAFELINK)!=0&&!sd_autolink_issafe(link.s)&&type!=MKDA_EMAIL)return 0;out.s+='<a href="';if(type==MKDA_EMAIL)out.s+="mailto:";escape_href(out,link.s.slice(offset));if(options.link_attributes){out.s+='"';options.link_attributes(out,link,options);out.s+=">"}else out.s+='">';if(link.s.indexOf("mailto:")==0)escape_html(out,
link.s.slice(7),false);else escape_html(out,link.s,false);out.s+="</a>";return 1},codespan:function codespan(out,text,options){out.s+="<code>";if(text)escape_html(out,text.s,false);out.s+="</code>";return 1},double_emphasis:function double_emphasis(out,text,options){if(!text||!text.s.length)return 0;out.s+="<strong>"+text.s+"</strong>";return 1},emphasis:function emphasis(out,text,options){if(!text||!text.s.length)return 0;out.s+="<em>"+text.s+"</em>";return 1},image:function image(out,link,title,
alt,options){if(!link||!link.s.length)return 0;out.s+='<img src="';escape_href(out,link.s);out.s+='" alt="';if(alt&&alt.s.length)escape_html(out,alt.s,false);if(title&&title.s.length){out.s+='" title="';escape_html(out,title.s,false)}out.s+=options.flags&HTML_USE_XHTML?'"/>':'">';return 1},linebreak:function linebreak(out,options){out.s+=options.flags&HTML_USE_XHTML?"<br/>\n":"<br>\n";return 1},link:function link(out,link,title,content,options){if(link!=null&&(options.flags&HTML_SAFELINK)!=0&&!sd_autolink_issafe(link.s))return 0;
-out.s+='<a href="';if(link&&link.s.length)escape_href(out,link.s);if(title&&title.s.length){out.s+='" title="';escape_html(out,title.s,false)}if(options.link_attributes){out.s+='"';options.link_attributes(out,link,options);out.s+=">"}else out.s+='">';if(content&&content.s.length)out.s+=content.s;out.s+="</a>";return 1},raw_html_tag:function raw_html_tag(out,tag,options){if((options.flags&HTML_ESCAPE)!=0){escape_html(out,text.s,false);return 1}if((options.flags&HTML_SKIP_HTML)!=0)return 1;if((options.flags&
+out.s+='<a href="';if(link&&link.s.length)escape_href(out,link.s);if(title&&title.s.length){out.s+='" title="';escape_html(out,title.s,false)}if(options.link_attributes){out.s+='"';options.link_attributes(out,link,options);out.s+=">"}else out.s+='">';if(content&&content.s.length)out.s+=content.s;out.s+="</a>";return 1},raw_html_tag:function raw_html_tag(out,text,options){if((options.flags&HTML_ESCAPE)!=0){escape_html(out,text.s,false);return 1}if((options.flags&HTML_SKIP_HTML)!=0)return 1;if((options.flags&
HTML_SKIP_STYLE)!=0&&sdhtml_is_tag(text.s,"style"))return 1;if((options.flags&HTML_SKIP_LINKS)!=0&&sdhtml_is_tag(text.s,"a"))return 1;if((options.flags&HTML_SKIP_IMAGES)!=0&&sdhtml_is_tag(text.s,"img"))return 1;out.s+=text.s;return 1},triple_emphasis:function triple_emphasis(out,text,options){if(!text||!text.s.length)return 0;out.s+="<strong><em>"+text.s+"</em></strong>";return 1},strikethrough:function strikethrough(out,text,options){if(!text||!text.s.length)return 0;out.s+="<del>"+text.s+"</del>";
return 1},superscript:function superscript(out,text,options){if(!text||!text.s.length)return 0;out.s+="<sup>"+text.s+"</sup>";return 1},entity:null,normal_text:function normal_text(out,text,options){if(text)escape_html(out,text.s,false)},doc_header:null,doc_footer:null};function char_emphasis(out,md,data_,offset){var data=data_.slice(offset);var size=data.length;var c=data[0];var ret;if(size>2&&data[1]!=c){if(c=="~"||_isspace(data[1])||(ret=parse_emph1(out,md,data,c))==0)return 0;return ret+1}if(data.length>
3&&data[1]==c&&data[2]!=c){if(_isspace(data[2])||(ret=parse_emph2(out,md,data,c))==0)return 0;return ret+2}if(data.length>4&&data[1]==c&&data[2]==c&&data[3]!=c){if(c=="~"||_isspace(data[3])||(ret=parse_emph3(out,md,data,c))==0)return 0;return ret+3}return 0}function char_codespan(out,md,data_,offset){var data=data_.slice(offset);var end,nb=0,i,f_begin,f_end;while(nb<data.length&&data[nb]=="`")nb++;i=0;for(end=nb;end<data.length&&i<nb;end++)if(data[end]=="`")i++;else i=0;if(i<nb&&end>=data.length)return 0;

0 comments on commit 0a56b0d

Please sign in to comment.