textformat
функция textformat используется для форматирования текста,
заключенного внтури ее. В основном, убирает лишние пробелы и
специальные символы, а так же форматирует абзацы, делает отступы,
переносит слова.
Можно указывать параметры явно, или использовать предустановленные стили.
На данный момент существует только стиль "email".
Пример 8-18. textformat {textformat wrap=40}
This is foo.
This is foo.
This is foo.
This is foo.
This is foo.
This is foo.
This is bar.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
{/textformat}
OUTPUT:
This is foo. This is foo. This is foo.
This is foo. This is foo. This is foo.
This is bar.
bar foo bar foo foo. bar foo bar foo
foo. bar foo bar foo foo. bar foo bar
foo foo. bar foo bar foo foo. bar foo
bar foo foo. bar foo bar foo foo.
{textformat wrap=40 indent=4}
This is foo.
This is foo.
This is foo.
This is foo.
This is foo.
This is foo.
This is bar.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
{/textformat}
OUTPUT:
This is foo. This is foo. This is
foo. This is foo. This is foo. This
is foo.
This is bar.
bar foo bar foo foo. bar foo bar foo
foo. bar foo bar foo foo. bar foo
bar foo foo. bar foo bar foo foo.
bar foo bar foo foo. bar foo bar
foo foo.
{textformat wrap=40 indent=4 indent_first=4}
This is foo.
This is foo.
This is foo.
This is foo.
This is foo.
This is foo.
This is bar.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
{/textformat}
OUTPUT:
This is foo. This is foo. This
is foo. This is foo. This is foo.
This is foo.
This is bar.
bar foo bar foo foo. bar foo bar
foo foo. bar foo bar foo foo. bar
foo bar foo foo. bar foo bar foo
foo. bar foo bar foo foo. bar foo
bar foo foo.
{textformat style="email"}
This is foo.
This is foo.
This is foo.
This is foo.
This is foo.
This is foo.
This is bar.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
bar foo bar foo foo.
{/textformat}
OUTPUT:
This is foo. This is foo. This is foo. This is foo. This is foo. This is
foo.
This is bar.
bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo
bar foo foo. bar foo bar foo foo. bar foo bar foo foo. bar foo bar foo
foo. |
|