Skip to main content



      Home
Home » Eclipse Projects » Mylyn » Wikitext OutlineItem: how can I get the heading text?
Wikitext OutlineItem: how can I get the heading text? [message #1684392] Wed, 18 March 2015 08:02 Go to next message
Eclipse UserFriend
We are using wikitext with mediawiki syntax, and try to get the original text of a heading from its OutlineItem.

I see two options, both of which have some limitation:
- getLabel(): looks good, but "could be truncated"
- getId(): seems to contain everything but decoding it difficult.

So far we are using getId() and decode in two steps:
- replace all '.' by '%'
- use URLDecoder.decode()

This actually worked fine, until we hit the first occurrence of '.' in an original heading. We could not find a way to distinguish a genuine '.' from the start of an escape sequence.

Is there a solution that avoids both limitations?
thanks
Stephan
Re: Wikitext OutlineItem: how can I get the heading text? [message #1695370 is a reply to message #1684392] Wed, 13 May 2015 15:16 Go to previous messageGo to next message
Eclipse UserFriend
Stephan,

Are you using the OutlineParser programatically? If so, truncation can be controlled using OutlineParser.setLabelMaxLength(). By default truncation does not occur, so as long as you're not setting a maximum length you should be in good shape.

Encoding of a heading ID is one-way and lossy, so not a good option to get the original heading text.

I hope that helps,

David
Re: Wikitext OutlineItem: how can I get the heading text? [message #1695655 is a reply to message #1695370] Mon, 18 May 2015 08:04 Go to previous message
Eclipse UserFriend
David Green wrote on Wed, 13 May 2015 21:16

Are you using the OutlineParser programatically? If so, truncation can be controlled using OutlineParser.setLabelMaxLength() ...


Yes, we call OutlineParser from our code. I'll check how we need to configure the parser to produce the desired result.

thanks,
Stephan

Previous Topic:Mylyn 3.14.2 is now available
Next Topic:using gerrit connector against openstack.review.org ?
Goto Forum:
  


Current Time: Thu May 15 06:51:29 EDT 2025

Powered by FUDForum. Page generated in 0.04638 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top