Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macros: Multiple uses of a macro replaces only one value in the template #20

Closed
elidhu opened this issue Apr 9, 2020 · 2 comments
Closed

Comments

@elidhu
Copy link

elidhu commented Apr 9, 2020

So what is happening is I'm trying to create a macro that will fill in relative links to other pages on our internal wiki.

It currently 'works' however it will fill all instances of the macro with the value that it first finds. I assume there is some hashmap in the program that is being populated with only one value?

I tried to have a look but I don't know go... anyway here is an example could you take a look and point me in the right direction in the codebase?

The template:

<ac:link><ri:page ri:content-title="{{ .Page }}"/></ac:link>

The macro:

<!-- Macro: \[WIKILINK\]\((.+)\)
     Template: templates/link.tmpl
     Page: ${1} -->

The input:

[WIKILINK](Test page one)
[WIKILINK](Test page two)

The output:

<ac:link><ri:page ri:content-title="Test page one"/></ac:link>
<ac:link><ri:page ri:content-title="Test page one"/></ac:link>
seletskiy added a commit that referenced this issue Apr 13, 2020
@seletskiy
Copy link
Collaborator

@kevinglasson: please try latest master, it should resolve the issue.

@elidhu
Copy link
Author

elidhu commented Apr 14, 2020

@seletskiy: Yep, all working thank you!

@elidhu elidhu closed this as completed Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants