Skip to content

Placeholder like {name} is missing if placed at the end of sentence after transform #722

@dgaponov

Description

@dgaponov

Package version

No response

Node version

No response

Platform

No response

What steps will reproduce the bug?

I encountered an issue when using @diplodoc/transform. If I use a placeholder like {name} at the end of a sentence, it disappears after running the transform function.

Example input:

Hello {name}

Expected output:

<p>Hello {name}</p>

Actual output:

<p>Hello</p>

I tried the same sample with markdown-it and there this issue does not occur — the placeholder is preserved.

Why does this happen?
Is this a known limitation of @diplodoc/transform? Could you please clarify the reason for this behavior?

Steps to reproduce:

const message = 'Hello {name}';
const result = transform(message).result.html;

console.log(result); // Output will be '<p>Hello</p>'

Additional context:

It feels like transform removes or mishandles such placeholders at sentence end.
Would appreciate any advice/workaround or a fix for this!

What is the expected behavior?

const message = 'Hello {name}';
const result = transform(message).result.html;

console.log(result); // '<p>Hello {name}</p>'

What do you see instead?

const message = 'Hello {name}';
const result = transform(message).result.html;

console.log(result); // '<p>Hello</p>'

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions