Today we released a new alpha version of Prince that supports a new CSS property that we cooked up for performing text replacement. It is loosely based on the
tr command in UNIX and Perl and was inspired by a specific use case of wanting to replace straight apostrophes (’) with curly right single quotes (U+2019), which are more aesthetically pleasing in some fonts and harmonise better with the use of curly double quotes. With the new property, this can be achieved like this:
prince-text-replace: "'" "\2019"
This is quite a simple and convenient way of making minor stylistic changes to the text without needing to apply any complicated transformations to the source document. Like the existing text-transform property, text replacement should not be used to alter the meaning of a document:
prince-text-replace: 'war' 'peace' 'ignorance' 'strength'
Similar tricks can be achieved using generated content of course; it is impossible in the general case to draw the line between style and semantics.
In the new alpha we also added support for the
xml:base attribute, which is handy when you need to process a local file that contains relative HTTP links. It also means that XInclude works properly now, as links in included documents will be resolved correctly relative to the location of the document that they occur in. With any luck this should be the last alpha version before the final release of Prince 6.0, hopefully later this month.