Skip to content

Markdown Conversion of HTML hostname option requires URL #31303

@thoukydides

Description

@thoukydides

Existing documentation URL(s)

What changes are you suggesting?

The description of the Markdown Conversion Options (e.g. for the env.AI.toMarkdown binding) describes the HTML hostname option as:

hostname: string to use as a host when resolving relative links inside the HTML.

The property name and this description suggests that a bare example.com style hostname (e.g. the result of URL.hostname) should be used. However, that leaves relative links in the markdown result (if there is no <base> element in the HTML itself).

It appears that this option actually requires a base URL, which will typically be the full URL of the page being converted (URL.origin wouldn't suffice for pages in sub-directories). The How It Works page hints at this, but it should be explicit in the description of the Conversion Options, especially since the option name itself is misleading.

Additional information

No response

Metadata

Metadata

Labels

content:editRequest for content editsdocumentationDocumentation editsproduct:workers-aiWorkers AI: https://developers.cloudflare.com/workers-ai/

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions