return true;
}
- public static function getContent($content) {
+ public static function fromContent($content) {
if (!$content) return;
static $finfo;
return $str;
}
- if ($mime === null) $mime = self::getContent($str);
+ if ($mime === null) $mime = self::fromContent($str);
if ($mime == 'text/plain') {
if ($v = self::html_video($str)) return $v;
#return $str .= '|'.$mime;
if ($default === null) $default = $str;
+ if (strpos($mime,'text/')===0) $default = htmlentities($default);
return $default;
}
--- /dev/null
+DROP TABLE IF EXISTS html_tag;
+CREATE TABLE IF NOT EXISTS html_tag (
+ tag varchar(1000) PRIMARY KEY,
+ link varchar(300),
+ description varchar(5000)
+);
+BEGIN TRANSACTION;
+DELETE FROM html_tag;
+COPY html_tag (tag,link,description) FROM PROGRAM '. /etc/profile && html2txt https://html.com/tags/ \
+| grep "^<" \
+| sed -E -e "s/ *HTML Tag *//" -e "s,^<([^>]+)>,\1\thttps://html.com/tags/iframe/\1/\t," \
+' WITH (format 'text', NULL '');
+COMMIT;
+