Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for markdown -> XAML parsing #17585

Open
wants to merge 47 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
fa76093
hey this works great
zadjii-msft May 24, 2024
fca7367
base classes for all, for fun and profit
zadjii-msft May 24, 2024
b84e49e
can I get a whoop, it builds
zadjii-msft May 24, 2024
1b4eb8e
wire it back up\
zadjii-msft May 24, 2024
c57f24e
this works with cmark-gfm
zadjii-msft Jul 9, 2024
d8f0d96
blindly follow the html format
zadjii-msft Jul 9, 2024
2545704
oh RichTextBlock can do anything, that's cool
zadjii-msft Jul 9, 2024
9fdf26a
this actually made things much worse
zadjii-msft Jul 10, 2024
686ce8e
much much better
zadjii-msft Jul 10, 2024
da4fe54
oh okay so the currency needs to be Span's
zadjii-msft Jul 10, 2024
50ee776
links work that's cool
zadjii-msft Jul 10, 2024
8a995cf
I need to go calm down this is so friggen cool
zadjii-msft Jul 10, 2024
d26c705
tooltips on images, and better header sizes
zadjii-msft Jul 10, 2024
e502fdc
lots of dead code
zadjii-msft Jul 10, 2024
826ad64
block quotes are uncomfortable
zadjii-msft Jul 10, 2024
52af5b3
not bad for one day
zadjii-msft Jul 10, 2024
f47665e
Merge remote-tracking branch 'origin/main' into dev/migrie/f/md-pane-…
zadjii-msft Jul 15, 2024
4d5de9f
lots of dead code cleanup
zadjii-msft Jul 15, 2024
efb88af
majorly move everything
zadjii-msft Jul 15, 2024
55f46f5
control codeblocks individually
zadjii-msft Jul 15, 2024
1e8a16d
moving more code around. Doesn't build. Need til::io, and to move thi…
zadjii-msft Jul 16, 2024
f3fb02f
Merge branch 'main' into dev/migrie/f/md-pane-official-2
zadjii-msft Jul 17, 2024
2aa0e72
basic 'dont explode on launch'
zadjii-msft Jul 17, 2024
16847e5
start moving to another project
zadjii-msft Jul 17, 2024
a09e3c1
plumbing is hard
zadjii-msft Jul 17, 2024
c888efb
cleanup for... review?
zadjii-msft Jul 17, 2024
7aae8d4
licenses and stuff
zadjii-msft Jul 18, 2024
2536d55
play buttons for fun
zadjii-msft Jul 18, 2024
73d5b81
Merge remote-tracking branch 'origin/main' into dev/migrie/f/md-pane-…
zadjii-msft Jul 18, 2024
5970d99
Merge remote-tracking branch 'origin/main' into dev/migrie/f/md-pane-…
zadjii-msft Jul 22, 2024
bfbfe30
switch to vcpkg
zadjii-msft Jul 22, 2024
8da2589
Merge remote-tracking branch 'origin/main' into dev/migrie/f/md-pane-…
zadjii-msft Jul 22, 2024
5132cef
wrong notice
zadjii-msft Jul 22, 2024
78a223e
unblock ci
zadjii-msft Jul 23, 2024
030b1fa
spel
zadjii-msft Jul 23, 2024
260bc92
more more spel
zadjii-msft Jul 23, 2024
3a9a060
piles of nits
zadjii-msft Jul 24, 2024
63fc231
Merge remote-tracking branch 'origin/main' into dev/migrie/f/md-pane-…
zadjii-msft Jul 29, 2024
fe5792a
Merge remote-tracking branch 'origin/main' into dev/migrie/f/md-pane-…
zadjii-msft Aug 19, 2024
6d5c886
til::u8u16 considered harmful i guess
zadjii-msft Aug 19, 2024
358819e
build break
zadjii-msft Aug 19, 2024
0c1157a
stash: why is this CurrentPararaph call load-bearing?
zadjii-msft Aug 19, 2024
ee3a759
Revert "stash: why is this CurrentPararaph call load-bearing?"
zadjii-msft Aug 19, 2024
0fb2616
consistent naming
zadjii-msft Aug 19, 2024
72b3fd7
we don't need no stinkin side effects here
zadjii-msft Aug 19, 2024
a92c157
definitely definitely no side effects
zadjii-msft Aug 19, 2024
ee3131b
high contrast isn't that hard
zadjii-msft Aug 19, 2024
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
definitely definitely no side effects
  • Loading branch information
zadjii-msft committed Aug 19, 2024
commit a92c1571842dfc2fcffac865807ff272c810396f
11 changes: 6 additions & 5 deletions src/cascadia/UIMarkdown/MarkdownToXaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ WUX::Documents::Run MarkdownToXaml::_NewRun()
{
if (_lastRun == nullptr)
{
// _lastRun = WUX::Documents::Run{};
// _CurrentSpan().Inlines().Append(_lastRun);
return _CurrentRun();
}
else
Expand Down Expand Up @@ -224,23 +222,28 @@ void MarkdownToXaml::_RenderNode(cmark_node* node, cmark_event_type ev_type)
if (entering)
{
_EndParagraph();
// _CurrentParagraph();
_NewRun().Text(bullets[std::clamp(_indent - _blockQuoteDepth - 1, 0, 2)]);
}
break;

case CMARK_NODE_HEADING:
{
_EndParagraph();

// At the start of a header, change the font size to match the new
// level of header we're at. The text will come later, in a
// CMARK_NODE_TEXT
if (entering)
{
// Insert a blank line, just to help break up the walls of text.
// This better reflects the way MD is rendered to HTML
_root.Blocks().Append(WUX::Documents::Paragraph{});

const auto level = cmark_node_get_heading_level(node);
_CurrentParagraph().FontSize(std::max(HeaderMinFontSize, H1FontSize - level * 6));
}
break;
}

case CMARK_NODE_CODE_BLOCK:
{
Expand All @@ -257,7 +260,6 @@ void MarkdownToXaml::_RenderNode(cmark_node* node, cmark_event_type ev_type)
_CurrentParagraph().Inlines().Append(codeContainer);

_EndParagraph();
_CurrentParagraph();
}
break;

Expand Down Expand Up @@ -298,7 +300,6 @@ void MarkdownToXaml::_RenderNode(cmark_node* node, cmark_event_type ev_type)
}

// Start a new paragraph if we don't have one
_CurrentParagraph();
break;
}
case CMARK_NODE_TEXT:
Expand Down