Hello All.
Does anyone know how I might export all marked text from the page? (confluence 5.85)
Text can by bold/italic/underline.
Example
source text:
export text:
Navigation
Customer Information Management
Residential Customers
New Residential Customer
Thank you.
You could write a small plugin extracting the body of the page and filter the content with a regular expression.
The page content is stored in XHTML so the bold text looks like this: <strong>some Text</strong>.
The RegEx might then look something like this: <strong>[A-z,-\s]+<\/strong>
To get the substrings out of the page content you might use something like this:
Pattern p0 = Pattern.compile("<strong>[A-z,-\s]+<\/strong>"); Matcher m = p0.matcher(pageContent); while (m.find()) { System.out.printf("%s%n", m.group(1)); }
Edit:
I guess this RegEx should be even better, because it matches any character except line breaks. Also you need two backslashes, one for Java and one for the RegEx syntax:
Pattern p0 = Pattern.compile("<strong>(.*)<\\/strong>");
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.