From d247bb6d5e540d87747aa1ad2c2c029e8852d404 Mon Sep 17 00:00:00 2001 From: Toni Gundogdu Date: Mon, 30 Jul 2012 21:17:35 +0300 Subject: [PATCH] Add util/convert_entities.lua This script is used by the library (from the C side of things) to convert any HTML entities to ASCII and UTF8. --- share/Makefile.am | 6 +++++- share/lua/util/convert_entities.lua | 27 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 share/lua/util/convert_entities.lua diff --git a/share/Makefile.am b/share/Makefile.am index 89dc968..43064be 100644 --- a/share/Makefile.am +++ b/share/Makefile.am @@ -17,9 +17,13 @@ DIST_lua+=\ lua/common/quvi/util.lua\ lua/common/quvi/youtube.lua +# Utility scripts. +DIST_lua+=\ + lua/util/convert_entities.lua\ + lua/util/to_file_ext.lua + DIST_lua+=\ lua/README \ - lua/util/to_file_ext.lua \ lua/website/README \ lua/website/101greatgoals.lua \ lua/website/1tvru.lua \ diff --git a/share/lua/util/convert_entities.lua b/share/lua/util/convert_entities.lua new file mode 100644 index 0000000..a2d5b20 --- /dev/null +++ b/share/lua/util/convert_entities.lua @@ -0,0 +1,27 @@ +-- libquvi-scripts +-- Copyright (C) 2012 Toni Gundogdu +-- +-- This file is part of libquvi-scripts . +-- +-- This library is free software; you can redistribute it and/or +-- modify it under the terms of the GNU Lesser General Public +-- License as published by the Free Software Foundation; either +-- version 2.1 of the License, or (at your option) any later version. +-- +-- This library is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +-- Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public +-- License along with this library; if not, write to the Free Software +-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +-- 02110-1301 USA +-- + +function convert_entities(qargs, s) + local E = require 'quvi/entity' + return E.convert_html(s) +end + +-- vim: set ts=2 sw=2 tw=72 expandtab: -- 2.11.4.GIT