buildkite / terminal-to-html

Converts arbitrary shell output (with ANSI) into beautifully rendered HTML
http://buildkite.github.io/terminal-to-html
MIT License
658 stars 44 forks source link

add backtick html code #64

Closed TheDen closed 5 years ago

TheDen commented 5 years ago

We've had issues using terminal-to-html with buildkite annotations when there are backticks, which seems to conflict with CommonMark. Using the HTML encoding ` ensures that backticks won't be parsed as MarkDown.

TheDen commented 5 years ago

I initially tried updating this file , i.e., something like

                b.buf.WriteString(""")
        case '/':
                b.buf.WriteString("/")
+       case '`':
+               b.buf.WriteString("`")
        default:
                b.buf.WriteRune(char)
        }

but that didn't work as expected with replacement when running the binary, and it also fails a test


go test
--- FAIL: TestRendererAgainstFixtures (0.05s)
    terminal_test.go:266: homer.sh did not match, got len 1108 and expected len 1100
FAIL
exit status 1
FAIL    github.com/TheDen/terminal      0.063s
make: *** [test] Error 1```
ticky commented 5 years ago

Hey @TheDen, I don’t think you should be running into those issues with it as it stands - can you shoot support@buildkite.com a link to a build where this is going wrong for you?

TheDen commented 5 years ago

Hey @ticky no problem, I sent an email (subject has this PR url). Thanks 👍