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

allow image attributes in markdown #111

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

vivganes
Copy link

No description provided.

@vitorpamplona
Copy link
Contributor

vitorpamplona commented Jul 24, 2023

+1 for this PR. But we might need to check if the composer doesn't need extra info for all possible attributes.

@vivganes
Copy link
Author

@halilozercan do you have any thoughts on this PR?

vitorpamplona and others added 19 commits August 7, 2024 03:37
This commit updates Compose Multiplatform to 1.4.1
AGP to 7.4.0
Kotlin to 18.10
Version updates;
- Kotlin 1.9.20
- AGP 8.2.0
- Gradle 8.2
- Compose Multiplatform: 1.5.11
- Compose Compiler: 1.5.4

Api Updates;
- Renamed RichText to BasicRichText
- Renamed MaterialRichText to RichText
- Renamed Material3RichText to RichText
- Removed SetupMaterialRichText
- Removed SetupMaterial3RichText
This fixes the start number of the markdown list. Markdown can
start with any number except -ve numbers. Rest numbers are
discarded
Markdown unfortunately does not have a universally agreed standard. Different flavors, libraries can parse Markdown content in their own ways. `richtext-commonmark` uses `Commonmark` spec and parser to convert any given markdown String into an intermediate Abstract Syntax Tree that has been defined internally since its release.

The idea has always been to extract this ASTNode structure out of this module to enable custom parsing logic to be supplied from outside, and make `richtext-commonmark` only responsible for rendering the given tree using `richtext-ui`.

This change introduces a new module named `richtext-markdown` which is actually just a rename of the existing `richtext-commonmark`. This new module also exposes its internal `AstNode` APIs to enable other modules to render their own AstNode structures.

`richtext-commonmark` becomes a helper module which can parse any given string into an AstNode via `CommonmarkAstNodeParser`. Also, it still provides a `RichTextScope.Markdown` function that simply does the conversion asynchronously, then calls the `Markdown(AstNode)` flavor from `richtext-markdown`.
This change includes bunch of misc tech debt cleaning.

- Use Compose Multiplatform dependencies instead of Google's Compose artifacts
- Removed Previews from richtext-ui.
- Renamed CodeBlock platform files.
- Kotlin updated to 1.9.22
- Compose compiler update to 1.5.8
- Changed MarkdownSample to use CommonmarkAstNodeParser and do synchronous Markdown rendering.
Text formatting objects should not carry any lambdas for mainly serialization and also control of link clicks should be on a click handler specified at Composable level.

Markdown will take advantage of richtext-ui built-in link click handling.
New API allows apps to render long Markdown documents lazily at the top level.
InlineContent is not supposed to have its own ParagraphStyle. That kind of workaround makes the content essentially "non-inline". Each inline content composable gets its own Paragraph. Instead, we should address the root of the problem which stems from the fact that default Material3 theming adds LineHeight by default.

Sample project now uses Material3 and overrides the default LineHeight to `TextUnit.Unspecified` in its theming. Inline content strictly respecting the line height argument should be addressed by the Compose team.
When rendering markdown lists, some list items may return empty an empty child set. This can be due to markdown content like the following

```
* hello
*
* world
```

In this case, markdown renderer should just put an empty Text in the second item so that `PrefixListLayout` has something to place and report its size correctly.
Lists should use relative placing to show correctly in RTL layouts.
This update also prepares the library for 1.0.0-alpha01 release.
This drops using AndroidView in HtmlBlock.
Fix a problem with new module docs titles
Also change the branch name for updating docs
@vivganes
Copy link
Author

vivganes commented Aug 6, 2024

@halilozercan - I have updated this branch with the latest changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants