Skip to content

I am using the turndown for converting html to markdown and want to match the orginal markdown #494

Description

@Bilal-Txend

Orginal Markdown:
Date of Birth: [Insert Patient's DOB]
Age: [Insert Patient's Age]
Author Name: [Author Name

Clinical Note:

35-year-old woman presenting However, the provided information seems to contain certain inconsistencies requiring clarification. Here are the key points for verification:

  1. Timeline:

    • The typical weeks.
    • there may be duplication or uncertainty.
    • needing more context.
  2. Clinical History: This section is currently missing.

Next Steps:

  • Kindly correct specific details, .
  • Review and provide any additional clinical notes or concerns.

This document will be updated once the discrepancies are resolved.


Let me know if you'd like to correct or adjust the information!

Html of this Content:

Date of Birth: [Insert Patient's DOB]
Age: [Insert Patient's Age]
[Author Name]:

Clinical Note:

35-year-old woman presenting However, the provided information seems to contain certain inconsistencies requiring clarification. Here are the key points for verification:

  1. Timeline:

    • The typical weeks
    • there may be duplication or uncertainty.
    • needing more context
  2. Clinical History: This section is currently missing.

Next Steps:

  • Kindly correct specific details,
  • Review and provide any additional clinical notes or concerns.

This document will be updated once the discrepancies are resolved.


Let me know if you'd like to correct or adjust the information!

when i convert its again from turndown i got this
Date of Birth**: [Insert Patient's DOB]Age: [Insert Patient's Age]Author Name: [Author Name]

Clinical Note:

35-year-old woman presenting However, the provided information seems to contain certain inconsistencies requiring clarification. Here are the key points for verification:

  • Timeline:

    • The typical human weeks.
    • there may be duplication or uncertainty.
    • needing more context.
  • Clinical History: This section is currently missing.

Next Steps:

  • Kindly correct specific details, especially regarding the timeline of pregnancy and gestational age.
  • Review and provide any additional clinical notes or concerns.

This document will be updated once the discrepancies are resolved.

Let me know if you'd like to correct or adjust the information!

I am using this function for convertion can anyone can help me for finding the solution

const turndownService = new TurndownService({
headingStyle: "setext",
bulletListMarker: "-",
codeBlockStyle: "indented",
emDelimiter: "_",
fence: "```",
strongDelimiter: "**",
linkStyle: "inlined",
linkReferenceStyle: "full",
hr: "\n\n---\n\n",
});
export function htmlToMarkdown(html) {
if (typeof html !== "string") {
throw new TypeError("htmlToMarkdown: input must be a string");
}
const wrappedHtmlString = <!DOCTYPE html><html><body>${html}</body></html>;
const domParser = new DOMParser();
const doc = domParser.parseFromString(wrappedHtmlString, "text/html");
const turndownInputNode = doc.documentElement;
if (!turndownInputNode) {
throw new Error(
"Failed to parse HTML into a usable DOM structure for Turndown."
);
}
const markdown = turndownService.turndown(turndownInputNode);
const cleanedMarkdown = markdown.replace(/\[/g, "[").replace(/\]/g, "]");

console.log(cleanedMarkdown);

return cleanedMarkdown;
}

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