Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion data/release-notes/enterprise-server/3-0/20.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ sections:
- Some critical services may not have been available on backend nodes in GHES Cluster.
changes:
- An additional outer layer of `gzip` compression when creating a cluster support bundle with `ghe-cluster-suport-bundle` is now turned off by default. This outer compression can optionally be applied with the `ghe-cluster-suport-bundle -c` command line option.
- Upgraded collectd to version 5.12.0.
- We have added extra text to the admin console to remind users about the mobile apps' data collection for experience improvement purposes.
known_issues:
- On a freshly set up {% data variables.product.prodname_ghe_server %} without any users, an attacker could create the first admin user.
Expand Down
1 change: 0 additions & 1 deletion data/release-notes/enterprise-server/3-1/12.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ sections:
- Some critical services may not have been available on backend nodes in GHES Cluster.
changes:
- An additional outer layer of `gzip` compression when creating a cluster support bundle with `ghe-cluster-suport-bundle` is now turned off by default. This outer compression can optionally be applied with the `ghe-cluster-suport-bundle -c` command line option.
- Upgraded collectd to version 5.12.0.
- We have added extra text to the admin console to remind users about the mobile apps' data collection for experience improvement purposes.
known_issues:
- The {% data variables.product.prodname_registry %} npm registry no longer returns a time value in metadata responses. This was done to allow for substantial performance improvements. We continue to have all the data necessary to return a time value as part of the metadata response and will resume returning this value in the future once we have solved the existing performance issues.
Expand Down
1 change: 0 additions & 1 deletion data/release-notes/enterprise-server/3-2/4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ sections:
- User defined patterns would not detect secrets in files like `package.json` or `yarn.lock`.
changes:
- An additional outer layer of `gzip` compression when creating a cluster support bundle with `ghe-cluster-suport-bundle` is now turned off by default. This outer compression can optionally be applied with the `ghe-cluster-suport-bundle -c` command line option.
- Upgraded collectd to version 5.12.0.
- We have added extra text to the admin console to remind users about the mobile apps' data collection for experience improvement purposes.
known_issues:
- On a freshly set up {% data variables.product.prodname_ghe_server %} without any users, an attacker could create the first admin user.
Expand Down
62 changes: 59 additions & 3 deletions tests/unit/render-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,70 @@ describe('renderContent', () => {
})

test('does syntax highlighting', async () => {
const template = nl(`
let template = nl(`
\`\`\`js
const example = true
\`\`\`\`
`)
const html = await renderContent(template)
const $ = cheerio.load(html, { xmlMode: true })
let html = await renderContent(template)
let $ = cheerio.load(html, { xmlMode: true })
expect($.html().includes('<pre><code class="hljs language-js">')).toBeTruthy()
expect($.html().includes('<span class="hljs-keyword">const</span>')).toBeTruthy()

template = nl(`
\`\`\`erb
<% @articles.each do |article| %>
\`\`\`\`
`)
html = await renderContent(template)
$ = cheerio.load(html, { xmlMode: true })
expect($.html().includes('<pre><code class="hljs language-erb">')).toBeTruthy()
expect($.html().includes('<span class="hljs-variable">@articles</span>')).toBeTruthy()

template = nl(`
\`\`\`http
POST / HTTP/2
\`\`\`\`
`)
html = await renderContent(template)
$ = cheerio.load(html, { xmlMode: true })
expect($.html().includes('<pre><code class="hljs language-http">')).toBeTruthy()
expect($.html().includes('<span class="hljs-keyword">POST</span>')).toBeTruthy()

template = nl(`
\`\`\`groovy
plugins {
...
id 'maven-publish'
}
\`\`\`\`
`)
html = await renderContent(template)
$ = cheerio.load(html, { xmlMode: true })
expect($.html().includes('<pre><code class="hljs language-groovy">')).toBeTruthy()
expect(
$.html().includes('<span class="hljs-string">&apos;maven-publish&apos;</span>')
).toBeTruthy()

template = nl(`
\`\`\`Dockerfile
FROM alpine:3.10
\`\`\`\`
`)
html = await renderContent(template)
$ = cheerio.load(html, { xmlMode: true })
expect($.html().includes('<pre><code class="hljs language-Dockerfile">')).toBeTruthy()
expect($.html().includes('<span class="hljs-keyword">FROM</span>')).toBeTruthy()

template = nl(`
\`\`\`Powershell
$resourceGroupName = "octocat-testgroup"
\`\`\`\`
`)
html = await renderContent(template)
$ = cheerio.load(html, { xmlMode: true })
expect($.html().includes('<pre><code class="hljs language-Powershell">')).toBeTruthy()
expect($.html().includes('<span class="hljs-variable">$resourceGroupName</span>')).toBeTruthy()
})

test('does not autoguess code block language', async () => {
Expand Down