comparison core/src/luan/modules/HtmlLuan.java @ 625:a3c1e11fb6aa

rewrite much of Html to be more understandable; add Lucene html_highlighter();
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 12 Jan 2016 23:52:56 -0700
parents 60c549d43988
children cdc70de628b5
comparison
equal deleted inserted replaced
624:8281a248c47e 625:a3c1e11fb6aa
45 public static final String SCRIPT = "script"; 45 public static final String SCRIPT = "script";
46 public static final String STYLE = "style"; 46 public static final String STYLE = "style";
47 47
48 public static Set<String> containerTags = new HashSet<String>(Arrays.asList(SCRIPT,STYLE)); 48 public static Set<String> containerTags = new HashSet<String>(Arrays.asList(SCRIPT,STYLE));
49 */ 49 */
50 /*
50 public static LuanTable parse(LuanState luan,String text,LuanTable containerTagsTbl) 51 public static LuanTable parse(LuanState luan,String text,LuanTable containerTagsTbl)
51 throws LuanException 52 throws LuanException
52 { 53 {
53 Utils.checkNotNull(luan,text); 54 Utils.checkNotNull(luan,text);
54 Utils.checkNotNull(luan,containerTagsTbl); 55 Utils.checkNotNull(luan,containerTagsTbl);
268 return s; 269 return s;
269 char c = s.charAt(0); 270 char c = s.charAt(0);
270 return (c=='"' || c=='\'') && s.charAt(s.length()-1)==c 271 return (c=='"' || c=='\'') && s.charAt(s.length()-1)==c
271 ? s.substring(1,s.length()-1) : s; 272 ? s.substring(1,s.length()-1) : s;
272 } 273 }
273 274 */
274 275
275 276
276 277 /*
277 public static String to_string(LuanState luan,LuanTable tbl) throws LuanException { 278 public static String to_string(LuanState luan,LuanTable tbl) throws LuanException {
278 List<Object> html = tbl.asList(); 279 List<Object> html = tbl.asList();
279 StringBuilder buf = new StringBuilder(); 280 StringBuilder buf = new StringBuilder();
280 for( Object o : html ) { 281 for( Object o : html ) {
281 if( o instanceof String ) { 282 if( o instanceof String ) {
322 if( tbl.get(luan,"is_empty").equals(Boolean.TRUE) ) 323 if( tbl.get(luan,"is_empty").equals(Boolean.TRUE) )
323 buf.append('/'); 324 buf.append('/');
324 buf.append('>'); 325 buf.append('>');
325 return buf.toString(); 326 return buf.toString();
326 } 327 }
327 328 */
328 public static String quote(String s) { 329 public static String quote(String s) {
329 StringBuilder buf = new StringBuilder(); 330 StringBuilder buf = new StringBuilder();
330 buf.append('"'); 331 buf.append('"');
331 int i = 0; 332 int i = 0;
332 while(true) { 333 while(true) {