Skip to content
Open
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
7 changes: 3 additions & 4 deletions Node/call-vertex-remote-config-server/client/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ import {
// Set to true to test in emulator.
const testMode = true;

// Use showdown to convert Gemini-provided Markdown to HTML
import { Converter } from "showdown";
const converter = new Converter();
// Use marked to convert Gemini-provided Markdown to HTML
import { marked } from "marked";

// Set up output elements.
const outputDiv = document.createElement("div");
Expand Down Expand Up @@ -100,7 +99,7 @@ promptForm.addEventListener("submit", async (event) => {
try {
const { data } = await callVertexWithRC({ prompt });
const generatedTextElement = document.getElementById("generatedText"); // Access the element
const htmlContent = converter.makeHtml(data);
const htmlContent = await marked.parse(data);
if (!generatedTextElement) {
throw new Error("Missing generated text.");
}
Expand Down
15 changes: 8 additions & 7 deletions Node/call-vertex-remote-config-server/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,24 @@
},
"engines": {
"npm": ">=9.0.0 <10.0.0",
"node": ">=18.0.0 <=20.0.0"
"node": "24"
},
"homepage": "https://github.com/firebase/functions-samples#readme",
"devDependencies": {
"eslint-config-google": "^0.14.0",
"typescript": "^5.1.6",
"vite": "^6.4.2"
"typescript": "^6.0.3",
"vite": "^8.0.16",
"@types/marked": "^5.0.2"
},
"scripts": {
"dev": "vite",
"build": "vite build",
"format": "prettier --write ."
},
"dependencies": {
"@firebase/functions": "^0.11.5",
"eslint": "9",
"firebase": "^10.12.1",
"showdown": "^2.1.0"
"@firebase/functions": "^0.13.5",
"eslint": "^8.57.1",
"firebase": "^12.14.0",
"marked": "^12.0.2"
}
}
Loading
Loading