Reference: Display Filters: Rewrap
Move Up Move to Top
Contents: Filter Overview User Interface & Options
Example Variables
Filter Overview This display filter rewraps text to a given percentage of the display width. It can also auto-detect tabular data and display it with no line wrapping in a fixed point font.

Back to Top

User Interface There are several configuration tabs for this filter. The first controls the action when rewrapping normal text:

The available configuration options are:

  • Quote Chars - Characters in this set separate quotation levels. The wrap filter will attempt to preserve quotes when rewrapping text. For more information, see the Highlight Quotes display filter.

  • Prefix Len - The maximum number of characters in a single quote prefix. For more information, see the Highlight Quotes display filter.

  • Wrap Width % - The text is wrapped to approximately this percentage of the article view display width.

  • Break Chars - Characters where word wrapping may break the line. This defaults to a single space character.

  • Min Wrap Len - The minimum line length that is a candidate for rewrap. Lines shorter than this will cause a line break.

  • Badwrap Fix - If set, an attempt is made to detect and fix bad wrapping by other software. For example, some text is posted like this:

      > > This is a line of quoted text, but
      this
      > > word is not wrapped correctly, and
      neither
      > > is this one.

    Setting this option will try to find and fix these cases. This feature is not perfect, but more often than not it will fix this problem without you ever noticing that the original article was badly formatted.

  • Prefix Heuristics - If enabled, the filter will use some heuristics to attempt to determine when a line prefix is intentional, and when it is accidental. For example, the prefix so: might occur as part of english text, and not be intended as a quote prefix. Or it might occur as part of text quoting someone named Sam Ospry. This heuristic attempts to make the correct determination.

  • NoFlow Pattern - This pattern can be set to match lines which should not be wrapped. For example, patterns to match various types of item lists are useful here.

  • Wrap Column - When used to modify text, such as when generating replies to articles, saving, or printing article text, this filter will wrap to this many characters instead of to a given percentage of the display width.

Tables

The other configuration area controls the behavior of the filter when used to detect tables. Although tabular data is not explicitly marked in usenet posts, this filter has the ability to automatically detect such tables and display them in a fixed point font with no line wrapping performed. This way, you can use an easy-to-read proportional font for normal article text, while still viewing tables such as Aminet charts or columns of race results in a readable manner. The table area of the UI looks like this:

The available configuration options are:

  • Table Heuristics - Turning this off will turn off the table detection feature entirely. By default, it is turned off, so you must manually enable it if you wish to use this feature. There is some performance penalty when using the table detection feature on normal text, but it is unnoticeable for normal sized articles on reasonably fast systems.

  • Min Table Rows - A table must contain at least this many rows to be detected as such. This is to prevent false triggering on non-tabular data.

  • Min Table Columns - A table must contain at least this many columns to be detected as such. This is to prevent false triggering on non-tabular data.

  • Min Table Probability - The table heuristic generates a probability for each line of text indicicating how likely NewsRog thinks this line of text is to be part of a table. This setting controls the minimum necessary probability for a table to be displayed as such. Settings of about 50 work well. Some poorly formatted tables may require a lower value to be detected, but the risk of detecting non-tabular data as a table increases when this number is decreased.

  • Max Intro Lines - A table is only detected when there is an empty line shortly before it. This setting controls the maximum number of non-tabular lines that may immediately precede a table.

  • Table Font - The table will be displayed with no line wrapping in this font. Generally this should be set to a fixed width (non-proportional) font so that the columns line up properly, although this is not strictly required.

Back to Top

Example Here is some original, unwrapped text:

And the same text with the rewrap filter turned on:

Tables

Here is a table without using the table feature, displayed in a proportional font (and with line wrapping turned off, so that you can see that it is a table - normally the rewrap filter would rewrap the table's lines, destroying the columns):

Here is the same table displayed in courier/11 fixed point font using the table feature:

Back to Top

Variables There are no variables supported by this filter.