Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mylyn-dev] how to support attribute replacement + rendering?

On 18 May 2015, at 20:08, Max Rydahl Andersen wrote:

Hey,

I'm trying to add attribute replacement in AsciiDoc.

i.e.

```
:eclipseurl: http://eclipse.org

Click {eclipse url} or link:{eclipse url}[here]
```

Should render as something like:

```
Click <a href="http://eclipse.org";>http://eclipse.org</a> or <a href="http://eclipse.org";>here</a>
```

I've added a `AsciidDocContentState` to collect the attributes key/values and then added a `AttributeToken` in addStandardTokens() that will replace the `{eclipseurl}` reference
with the value.

That works perfectly *BUT* the result is actually not reparsed meaning I only get:

```
Click http://eclipse.org or http://eclipse.org[here]
```

Is there some way to make it "rerender" after a token have been replaced or is there
some other way to support attribute/token replacement ?

So I figured I could put in a PreProcessor that does this *Before* doing the main rendering, but still wondering if there is a way to do this while parsing since that could be useful in
other contexts.

/max
http://about.me/maxandersen


Back to the top