Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into validate_latest
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoscaceres committed Feb 16, 2022
2 parents 654ea3b + 33a0897 commit 0f3940b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ jobs:
npx brrr builds/respec-w3c.js -o builds
file_size=$(stat -c%s "builds/respec-w3c.js")
xfer_file_size=$(stat -c%s "builds/respec-w3c.js.br")
curl --fail -L -X PUT "https://respec.org/respec/size" \
curl -L -X PUT "https://respec.org/respec/size" \
-H "Authorization: $RESPEC_SECRET" \
-s -w "HTTP Response Code: %{http_code}\n" \
-d "size=$file_size" -d "xferSize=$xfer_file_size "\
-d "sha=$GITHUB_SHA" -d "timestamp=$timestamp"
env:
Expand Down
12 changes: 9 additions & 3 deletions src/core/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import { html, pluralize } from "./import-maps.js";
import css from "../styles/ui.css.js";
import { markdownToHtml } from "./markdown.js";
import { reindent } from "./reindent.js";
import { sub } from "./pubsubhub.js";
export const name = "core/ui";

Expand Down Expand Up @@ -266,10 +267,15 @@ function rsErrorToHTML(err) {
const plugin = err.plugin
? `<p class="respec-plugin">(plugin: "${err.plugin}")</p>`
: "";

const hint = err.hint
? `\n<p class="respec-hint"><strong>How to fix:</strong> ${markdownToHtml(
err.hint,
{ inline: true }
? `\n${markdownToHtml(
`<p class="respec-hint"><strong>How to fix:</strong> ${reindent(
err.hint
)}`,
{
inline: !err.hint.includes("\n"),
}
)}\n`
: "";
const elements = Array.isArray(err.elements)
Expand Down
4 changes: 1 addition & 3 deletions src/core/xref.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,7 @@ function showErrors({ ambiguous, notFound }) {
};

const howToFix = (howToCiteURL, originalTerm) => {
return docLink`
[See search matches for "${originalTerm}"](${howToCiteURL}) or
${"[Learn about this error|#error-term-not-found]"}.`;
return docLink`[See search matches for "${originalTerm}"](${howToCiteURL}) or ${"[Learn about this error|#error-term-not-found]"}.`;
};

for (const { query, elems } of notFound.values()) {
Expand Down

0 comments on commit 0f3940b

Please sign in to comment.