Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 12:02 Go to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
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 19:16 Go to previous messageGo to next message
David Green is currently offline David GreenFriend
Messages: 136
Registered: July 2009
Senior Member
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 12:04 Go to previous message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
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 Apr 25 14:28:36 GMT 2024

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

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

Back to the top