comparison src/luan/modules/parsers/BBCode.java @ 1248:475905984870

improve lucene highlighter and allow bbcode_to_text quoter to be nil
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 18 Jul 2018 01:38:53 -0600
parents 728d8e75f476
children 25746915a241
comparison
equal deleted inserted replaced
1247:728d8e75f476 1248:475905984870
278 String rtn = toHtml ? "<iframe width='420' height='315' src='https://www.youtube.com/embed/"+id+"' frameborder='0' allowfullscreen></iframe>" : ""; 278 String rtn = toHtml ? "<iframe width='420' height='315' src='https://www.youtube.com/embed/"+id+"' frameborder='0' allowfullscreen></iframe>" : "";
279 return parser.success(rtn); 279 return parser.success(rtn);
280 } 280 }
281 281
282 private String quote(Object... args) throws LuanException { 282 private String quote(Object... args) throws LuanException {
283 if( quoter==null ) 283 if( quoter==null ) {
284 throw new LuanException("BBCode quoter function not defined"); 284 if( toHtml )
285 throw new LuanException("BBCode quoter function not defined");
286 else
287 return "";
288 }
285 Object obj = quoter.call(luan,args); 289 Object obj = quoter.call(luan,args);
286 if( !(obj instanceof String) ) 290 if( !(obj instanceof String) )
287 throw new LuanException("BBCode quoter function returned "+Luan.type(obj)+" but string required"); 291 throw new LuanException("BBCode quoter function returned "+Luan.type(obj)+" but string required");
288 return (String)obj; 292 return (String)obj;
289 } 293 }