Skip to content

Make Nuemark work on browsers #640

@appurist

Description

@appurist

Describe the Bug

Nuemark can't be used by browser code, it has a nasty dependency on Node.js modules and can only be used in server code.

I'm not sure if this is a bug or intentional limitation but it does not seem like Nuemark was intended to only be used server-side so I will assume it's a bug until clarified.

Environment

Ubuntu 22.04 but all environments.

Minimal Reproduction

import { nuemark } from 'nuemark/index.js'
const html = nuemark(`Hello, World`)
console.info(html) // Hello, World

Logs & Additional Context

The first two lines of render-tag.js are:

import { join, extname } from 'node:path'
import { readFileSync } from 'node:fs'

These are mostly needed to load an svg icon in readIcon because it does not render the name of the file as the svg source, but actually tries to do a server-side read of the SVG content and insert it into the svg element.

I would like to see Nuemark support browser/client-side use, especially if it's only for svg icons that it is broken there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions