diff src/luan/modules/parsers/BBCode.java @ 777:1460d297e960

add bbcode to blog example
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 26 Aug 2016 15:42:15 -0600
parents 1a68fc55a80c
children 88b5b81cad4a
line wrap: on
line diff
--- a/src/luan/modules/parsers/BBCode.java	Fri Aug 26 14:39:18 2016 -0600
+++ b/src/luan/modules/parsers/BBCode.java	Fri Aug 26 15:42:15 2016 -0600
@@ -26,7 +26,7 @@
 
 	private BBCode(LuanState luan,String text,LuanFunction quoter,boolean toHtml) throws LuanException {
 		Utils.checkNotNull(text,1);
-		Utils.checkNotNull(quoter,2);
+//		Utils.checkNotNull(quoter,2);
 		this.luan = luan;
 		this.parser = new Parser(text);
 		this.quoter = quoter;
@@ -264,6 +264,8 @@
 	}
 
 	private String quote(Object... args) throws LuanException {
+		if( quoter==null )
+			throw new LuanException("BBCode quoter function not defined");
 		Object obj = quoter.call(luan,args);
 		if( !(obj instanceof String) )
 			throw new LuanException("BBCode quoter function returned "+Luan.type(obj)+" but string required");