© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3y ago•
2 replies
saors

Stripping HTML from within edge function

I have some data that I fetch externally. One of the properties contains encoded HTML as a string.
I need to parse and retrieve only the text from this html.

I was trying to use the deno-dom package like so:

import { DOMParser } from "https://deno.land/x/deno_dom@v0.1.43/deno-dom-wasm.ts"
...
stripHTML(encoded: string) {
  const html = new DOMParser().parseFromString(encoded, 'text/html');
  return html?.textContent || '';
}
import { DOMParser } from "https://deno.land/x/deno_dom@v0.1.43/deno-dom-wasm.ts"
...
stripHTML(encoded: string) {
  const html = new DOMParser().parseFromString(encoded, 'text/html');
  return html?.textContent || '';
}


But I'm getting 546 error CPU time limit reached with this approach.
Is there any way I can achieve the same result without hitting the cpu limit?
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Edge Function - HTML Doesn’t Run
SupabaseSSupabase / help-and-questions
3mo ago
42P01 error from edge function
SupabaseSSupabase / help-and-questions
4mo ago
Return Error from Edge Function
SupabaseSSupabase / help-and-questions
4y ago
Query table from edge function
SupabaseSSupabase / help-and-questions
4y ago