Skip to content

Commit

Permalink
fix: getMessageAPI so it considers entity codes
Browse files Browse the repository at this point in the history
  • Loading branch information
ad1992 committed Oct 31, 2023
1 parent d714ecb commit 390e22c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/mermaid/src/Diagram.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { detectType, getDiagramLoader } from './diagram-api/detectType.js';
import { UnknownDiagramError } from './errors.js';
import type { DetailedError } from './utils.js';
import type { DiagramDefinition, DiagramMetadata } from './diagram-api/types.js';
import { encodeEntities } from './mermaidAPI.js';

export type ParseErrorFunction = (err: string | DetailedError | unknown, hash?: any) => void;

Expand Down Expand Up @@ -81,6 +82,8 @@ export const getDiagramFromText = async (
text: string,
metadata: Pick<DiagramMetadata, 'title'> = {}
): Promise<Diagram> => {
text = encodeEntities(text);

const type = detectType(text, configApi.getConfig());
try {
// Trying to find the diagram
Expand Down

0 comments on commit 390e22c

Please sign in to comment.