Skip to content

I'm getting Uncaught (in promise) TypeError: marked is not a function #3645

@landed1

Description

@landed1

Hi

I am almost ready to complete a small Joomla component but I'd like the AI chat widget to show nice formatted returns and I found your script recommended by openai.

Useage inside Joomla component:

$document->addScript('https://cdn.jsdelivr.net/npm/marked/marked.min.js', ['integrity' => 'sha512-...', 'crossorigin' => 'anonymous', 'referrerpolicy' => 'no-referrer']);

$document->addScript('components/com_variableslug/assets/js/ai.js?v=1.0.' . time());

The second script is where I ref 'marked'

// Convert markdown to HTML using Marked
  const htmlContent = marked(text);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions