MCPcopy Index your code
hub / github.com/deepnote/deepnote / escapeTripleQuote

Function escapeTripleQuote

packages/convert/src/deepnote-to-marimo.ts:296–300  ·  view source on GitHub ↗

* Escapes content for use in a Python raw triple-quoted string (r"""). * Raw strings don't interpret escape sequences, so we can't use backslashes to escape. * When we encounter triple quotes, we break the raw string and concatenate with a regular string.

(str: string)

Source from the content-addressed store, hash-verified

294 * When we encounter triple quotes, we break the raw string and concatenate with a regular string.
295 */
296function escapeTripleQuote(str: string): string {
297 // Split the raw string at """ and concatenate with a regular string containing the quote
298 // r"""text""" becomes r"""text""" + '"' + r"""more"""
299 return str.replace(/"""/g, '"""+\'"\'+r"""')
300}

Callers 1

serializeMarimoFormatFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected