HTML.pm


NAME

Communiware::Format::HTML - preprocess routines which are called on item texts before placing them into database


SYNOPSIS

$text = Communiware::Format::HTML::ToInternal($text,$attrs) $text = Communiware::Format::HTML::FromInternal($ctx,$text) $text = Communiware::Format::HTML::ToPlugin($ctx,$text)


DESCRIPTION

This module provides preprocessing functions, used by various posing interfaces to convert data into HTML, which would be stored in the Communiware database

ToInternal

Preprocesses html, uploaded via moderate. Recieves text and reference to the hash of attributes. Finds references to other items and puts them in the HREF element of hash. Finds all <IMG> tags, corrects image size if image is available, rewrites SRC attribute to /pictures/item_id/image.name if it contain no slashes, and puts image name to the IMAGES element of the hash.

Syntax

   ToInternal $text,\%attributes

Replaces $attributes{HREF} and $attributes{IMAGES} by list of links and images found in document.

Returns changed text

ToPlugin

This procedure converts relative pic_paths to absolute, using PREFIX method of given context.

16 октябрь 2007 13:44