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

unable/difficult to render html in messages #40

Open
rcousineau-xandr opened this issue Jul 24, 2023 · 0 comments
Open

unable/difficult to render html in messages #40

rcousineau-xandr opened this issue Jul 24, 2023 · 0 comments
Assignees

Comments

@rcousineau-xandr
Copy link
Contributor

in the evaluate function, parentheses and colons are escaped:

function evaluate {
  __var=$1
  # escape ( and ) from markdown
  __var="${__var//\(/\\(}"
  __var="${__var//\)/\\)}"
  __var="${__var//\:/\\:}"
  __var=`eval echo $__var`
  echo $__var
}

i'm trying to send a message that includes <pre> which I know is possible (did it with a bot) in Teams messages

the error I got was:

/opt/resource/out: eval: line 16: syntax error near unexpected token `newline'

tried quoting the message like so:

          text: |
            "The **$BUILD_JOB_NAME** job FAILED ($BUILD_PIPELINE_NAME)<pre>test</pre>"

and was greeted with a new error:

Newtonsoft.Json.JsonReaderException: Bad JSON escape sequence: \(. Path 'text', line 1, position 67.

I don't know if more symbols need to be escaped, or if I need to escape the brackets in the yaml, or if this is simply impossible because of bash...

@navicore navicore self-assigned this Jul 25, 2023
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