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

Variable content being interpreted while we want raw text #1351

Closed
briceparmentier opened this issue Feb 15, 2022 · 5 comments
Closed

Variable content being interpreted while we want raw text #1351

briceparmentier opened this issue Feb 15, 2022 · 5 comments

Comments

@briceparmentier
Copy link

Hello there,

I've googled a lot about this but couldn't find any answer. Also I don't know if this could be a bug or a feature request, so please be kind if I'm in the wrong section 😛

I want to use for example existing FitNesse variable like ${RUNNING_PAGE_NAME} which gives me the current test page name.
This gives something like "MyPageName", which will be interpreted by the renderer as it is camel case syntax, so on the page it will be replaced by an HTML link like "MyPageName".
But in our case we want to use this "MyPageName" as raw text (without the HTML stuff around) to pass it along to the fixture code (C++ code using CSlim in our case).

I've tried a lot of combinations using !- -! to have markup literal text, but none worked. Always getting "${myVar}" (or "${RUNNING_PAGE_NAME}" in my example) as raw text, not the content of the variable.

Any thoughts on this one?
Thanks a lot in advance.

Brice

@jediwhale
Copy link
Collaborator

I couldn't find a way to do what you want! I think we might need a new predefined variable, e.g. RUNNING_PAGE_NAME_TEXT that is defined as literal text rather than the wiki name.

@tcnh
Copy link
Contributor

tcnh commented Feb 16, 2022

You can do this using the (new-ish #1310) no links prefix (^) on your table. This will prevent the wiki from messing with your inputs by creating links on wiki words or e-mail addresses, but will still stranslate symbols like ${RUNNING_PAGE_NAME} or !today (as opposed to using a ! as table prefix)

Example that sets the plain text value to a slim symbol:

|import           |
|fitnesse.fixtures|

^|script   |echo fixture             |
|$pageName=|echo|${RUNNING_PAGE_NAME}|

Outputs:
image

edit: having said that, I think just using ! should also work, as I think that these variables will also expand there. Check the link six42 posted below :)

@six42
Copy link
Contributor

six42 commented Feb 16, 2022 via email

@jediwhale
Copy link
Collaborator

I forgot about the table prefix flags!

@briceparmentier
Copy link
Author

Hmmm thanks for this link, I will have a deeper look at and test it !

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

4 participants