
Research
/Security News
GlassWASM: WebAssembly Malware Found in Trojanized Open VSX Extensions
The trojanized extensions use TinyGo-compiled WebAssembly and Solana transaction memos to resolve command-and-control infrastructure.
@prairielearn/html
Advanced tools
@prairielearn/htmlUtilities for easily rendering HTML from within JavaScript.
The html tagged template literal can be used to render HTML while ensuring that any interpolated values are properly escaped.
By convention, HTML templates are located in *.html.tmpl.js files.
// Hello.html.tmpl.js
const { hmtl } = require('@prairielearn/html');
module.exports.Hello = function Hello({ name }) {
return html`<div>Hello, ${name}!</div>`;
};
This can then be used to render a string:
const { Hello } = require('./Hello');
console.log(Hello({ name: 'Anjali' }).toString());
// Prints "<div>Hello, Anjali!</div>"
If you want to pre-escape some HTML, you can wrap it in escapeHtml to avoid escaping it twice. This is useful if you want to inline some HTML into an attribute, for instance with a Bootstrap popover.
const { html, escapeHtml } = require('@prairielearn/html');
console.log(html`
<button data-bs-toggle="popover" data-bs-content="${escapeHtml(html`<div>Content here</div>`)}">
Open popover
</button>
`);
PrairieLearn used (and still uses) EJS to render most views. However, using a tagged template literal and pure JavaScript to render views has a number of advantages:
html tagged template literal; EJS does not have any automatic formatters.If you want to use existing EJS partials inside of an html tagged template literal, check out the @prairielearn/html-ejs package. EJS-related functionality is deliberately located in a separate package so that @prairielearn/html can be used in the browser, since the ejs package makes use of Node-only features.
FAQs
Utilities for easily rendering HTML from within JavaScript.
The npm package @prairielearn/html receives a total of 464 weekly downloads. As such, @prairielearn/html popularity was classified as not popular.
We found that @prairielearn/html demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
The trojanized extensions use TinyGo-compiled WebAssembly and Solana transaction memos to resolve command-and-control infrastructure.

Security News
Anthropic says the directive cited national security concerns over a narrow jailbreak, but offered no specific technical details.

Security News
A network of 152 Chrome live wallpaper extensions hid ad tracking and made extension-driven traffic look like Google search clicks.