feat: update comrak to 0.43.0, introduce 25 new rendering features#18
feat: update comrak to 0.43.0, introduce 25 new rendering features#18
Conversation
Co-authored-by: nberlette <11234104+nberlette@users.noreply.github.com>
Co-authored-by: nberlette <11234104+nberlette@users.noreply.github.com>
…minimize_commonmark) Co-authored-by: nberlette <11234104+nberlette@users.noreply.github.com>
There was a problem hiding this comment.
@copilot The flat options structure feels a bit superfluous. I think we should do away with it entirely and handle each of the three kinds of options directly. This should simplify both the rust and typescript sides of our codebase. If we also leverage serde's field-renaming capabilities, we can also get rid of the redundant Options type definition exported (exported as a static string in lib.rs), since the types will be handled by mod.ts. That will also improve maintainability significantly.
|
@copilot resolve all suggestions in my review comments please |
Co-authored-by: nberlette <11234104+nberlette@users.noreply.github.com>
Refactored the codebase to remove the flat options structure. Now using properly nested
All suggestions resolved in commit 73b812c:
|
Signed-off-by: Nick Berlette <nick@berlette.com>
Co-authored-by: nberlette <11234104+nberlette@users.noreply.github.com>
Overview
This PR updates the
comrakdependency from 0.17.0 to 0.43.0, bringing 25 new markdown rendering features to comrak-wasm while maintaining full backward compatibility.Recent Changes
extension,parse, andrenderoptionsOPTIONS_TYPEstatic string export (TypeScript types now handled in mod.ts)wikilinksTitleenum ("before" | "after")#[serde(default)]at struct level for DRY codeWhat's New
GitHub-Style Features
> [!note],> [!warning], etc.)$E=mc^2$) and code syntax ($`x^2`$).contains-task-list,.task-list-item)Text Formatting Extensions
H~2~O)__important__)||spoiler||)Link Enhancements
[[url|title]]and[[title|url]]formats via unifiedwikilinksTitleoptionContent Organization
>>>)Rendering Controls
data-sourceposattributes for debugging<span data-escaped-char><figure>elements with captionsBreaking Changes
None. All new features are opt-in with sensible defaults. Existing code continues to work without modifications.
Not Implemented
The following features from comrak 0.43.0 are intentionally deferred due to technical complexity:
imageUrlRewriter,linkUrlRewriter) - Requires complex JavaScript-to-Rust function conversionThese features can be added in a future update if needed.
Closes #17
Original prompt
Fixes #17
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.