Avoid format errors when using output=wiki - 11.x
Avoid format errors when using output=wiki - 11.x
Summary
If you use output=wiki, the table is produced using wiki table notation. Data found within the table may contain wiki text that may interfere with the formatting of the table.
Solution
Such values either need to be escaped or surrounded by constructs that prevent this. Modify your SQL statement to do this.
Examples
- Use a panel
'{panel:borderStyle=none|bgColor=#ffffff} ' || myfield || ' {panel}'
- Use a div - needs the Adaptivist Content Formatting app
'{div:style=left:1em;right:1em} ' || myfield || ' {div}'
Better Solution
If you have administration access to your database, it makes it a lot more convenient for your users to create a few convenience functions in your database to do this automatically.
confluence_text function for PostgreSQL
-- Function: confluence_text(text) -- DROP FUNCTION confluence_text(text); CREATE OR REPLACE FUNCTION confluence_text(text) RETURNS text AS $BODY$ select '{div:style=left:1em;right:1em} ' || $1 || ' {div}' $BODY$ LANGUAGE 'sql' STABLE COST 100; ALTER FUNCTION confluence_text(text) OWNER TO postgres; COMMENT ON FUNCTION confluence_text(text) IS 'Confluence - wrap text in a div to protect against table format errors';
confluence_panel function for PostgreSQL
-- Function: confluence_panel(text) -- DROP FUNCTION confluence_panel(text); CREATE OR REPLACE FUNCTION confluence_panel(text) RETURNS text AS $BODY$ select '{panel:borderStyle=none|bgColor=#ffffff} ' || $1 || ' {panel}' $BODY$ LANGUAGE 'sql' STABLE COST 100; ALTER FUNCTION confluence_panel(text) OWNER TO postgres; COMMENT ON FUNCTION confluence_panel(text) IS 'Confluence - wrap a panel around a string';
Then, the examples above are much easier:
confluence_panel(myfield)
confluence_text(myfield)
, multiple selections available,
Related content
How to avoid format errors when using output=wiki
How to avoid format errors when using output=wiki
More like this
How to render wiki from XML or XSL files
How to render wiki from XML or XSL files
More like this
renderWiki
renderWiki
More like this
_HowToDealWithTemplatesOnConfluence43AndLater
_HowToDealWithTemplatesOnConfluence43AndLater
More like this
_Header
_Header
More like this
convertToStorageFormat
convertToStorageFormat
More like this
Need support? Create a request with our support team.
Copyright © 2005 - 2025 Appfire | All rights reserved.