Skip to content

Commit

Permalink
Fix renderTokens: options were not always passed to next recursive ca…
Browse files Browse the repository at this point in the history
…ll (#869)
  • Loading branch information
psrok1 committed Jul 31, 2023
1 parent 18c1339 commit 0925e95
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions mwdb/web/src/commons/helpers/renderTokens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,18 @@ export function renderTokens(tokens: Token[], options?: Option): any {
list(token: Token) {
return (
<ul key={uniqueId()} style={{ margin: "0" }}>
{token.items?.map((item: Token) => renderTokens([item]))}
{token.items?.map((item: Token) =>
renderTokens([item], options)
)}
</ul>
);
},
list_item(token: Token) {
return <li key={uniqueId()}>{renderTokens(token.tokens ?? [])}</li>;
return (
<li key={uniqueId()}>
{renderTokens(token.tokens ?? [], options)}
</li>
);
},
html(token: Token) {
return token.text;
Expand Down

0 comments on commit 0925e95

Please sign in to comment.