Demo of an experimental lua-based markup language
on.mouse_press = function(x,y, mouse_button)
	print('mouse press', x,y)
	if Cursor_node then
		Cursor_node.show_cursor = nil
		Cursor_node = nil
	end
	local node = to_text(x,y)
	if node then
		-- position cursor in node
		Cursor_node = node
		print('within node')
		edit.mouse_press(node.editor, x,y, mouse_button)
		print('cursor at', node.editor.cursor_x, node.editor.cursor_y)
		return
	end
	-- pan surface
	Pan = {x=Viewport.x+x/Viewport.zoom, y=Viewport.y+y/Viewport.zoom}
end