diplodoc-platform / diplodoc-platform/transform
Placeholder like {name} is missing if placed at the end of sentence after transform
- Dominant language
- TypeScript
- Stars
- 69
- Forks
- 59
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 6
Description
### 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:**
```
Hello {name}
```
**Actual output:**
```
Hello
```
I tried the same sample with [markdown-it](https://github.com/markdown-it/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 '
Hello
'```
**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); // '
Hello {name}
'```
### What do you see instead?
```
const message = 'Hello {name}';
const result = transform(message).result.html;
console.log(result); // '
Hello
'```
### Additional information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.