Skip to content

Conversation

@vitorpamplona
Copy link
Contributor

I have a need to add my own custom extensions to the parser and thought this could be a good generalization for everyone else.

This opens up MarkdownParseOptions to some flexibility in enabling or disabling extensions.

Copy link
Owner

@halilozercan halilozercan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for reviewing the PR half a year late.

/**
* Allows configuration of the Markdown parser
*
* @param autolink Detect plain text links and turn them into Markdown links.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to update kdoc.

public data class MarkdownParseOptions(
val autolink: Boolean
) {
public data class MarkdownParseOptions(val extensions: List<Extension>) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since richtext-commonmark and richtext-markdown are now separate modules I'm not as opposed to exposing commonmark details as I had been before, but I still would prefer if extensions were exposed as a value class.

value class MarkdownExtension private constructor(internal val value: Int) {
  companion object {
    val Tables = ...
    val AutoLink = ...
    ...
  }
}

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.

2 participants