Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Configuration options? #177

Closed
clphillips opened this issue Sep 10, 2015 · 5 comments
Closed

Configuration options? #177

clphillips opened this issue Sep 10, 2015 · 5 comments
Assignees
Labels
documentation Documentation issues or updates question General questions about the project or usage

Comments

@clphillips
Copy link

I'm looking for the configuration options that can be passed to League\CommonMark\CommonMarkConverter::__construct and Environment, but can't find that anywhere in the docs, source docs, or tests.

Am I missing something?

The only other reference I can find is #42, but I can't believe that's an exhaustive list.

@colinodell colinodell added question General questions about the project or usage documentation Documentation issues or updates labels Sep 10, 2015
@colinodell
Copy link
Member

There are currently only three configuration options, and they're all under the renderer key:

$defaultConfig = [
    'renderer' => [
        'block_separator' => "\n",
        'inner_separator' => "\n",
        'soft_break'      => "\n",
    ],
];

There simply hasn't been a need to configure additional settings, but the mechanism is there should we need it. #42 demonstrates some examples of how we could expand the configuration in the future. In addition, it's entirely possible for custom extensions to define their own configuration options as needed.

I'm definitely open to any ideas or PRs you have for new configuration options.

I'll keep this issue open until the current options have been documented properly.

@colinodell colinodell self-assigned this Sep 10, 2015
@clphillips
Copy link
Author

@colinodell, so I'd need to roll my own parser to get an HTML safe version (one that escapes all HTML input, e.g. has no allowed tags)?

@colinodell
Copy link
Member

Unfortunately that is not currently configurable. If you want to escape all HTML output, I'd think that excluding the HTML parsers (HtmlBlockParser and RawHtmlParser) from your environment would work. (I wonder what would happen if you only excluded one and not the other - that might be something to play with.)

I think having a configuration option for HTML is a fantastic idea though, and it's definitely something I'd want to have implemented before a v1.0 release.

@colinodell
Copy link
Member

You could also look at replacing the renderers instead (with ones that escape the raw HTML output).

@clphillips
Copy link
Author

Cool, I'll take a look.

colinodell added a commit that referenced this issue Sep 19, 2015
@thephpleague thephpleague locked and limited conversation to collaborators Jun 12, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
documentation Documentation issues or updates question General questions about the project or usage
Projects
None yet
Development

No branches or pull requests

2 participants