public function ReadmehelpMarkdown::settingsForm in README Help 8
Generates a filter's settings form.
Parameters
array $form: A minimally prepopulated form array.
\Drupal\Core\Form\FormStateInterface $form_state: The state of the (entire) configuration form.
Return value
array The $form array with additional form elements for the settings of this filter. The submitted form values should match $this->settings.
Overrides FilterBase::settingsForm
File
- src/
Plugin/ Filter/ ReadmehelpMarkdown.php, line 32
Class
- ReadmehelpMarkdown
- Provides a filter for markdown.
Namespace
Drupal\readmehelp\Plugin\FilterCode
public function settingsForm(array $form, FormStateInterface $form_state) {
$form['quick_tips'] = [
'#type' => 'item',
'#title' => $this
->t('Quick tips'),
'#description' => $this
->t('You can use <a href=":readmehelp" name=":name">markdown syntax</a> like in README files to format and style the text. This syntax is a subset of the <a href=":github">Github Flavoured Markdown</a>. Note that this filter will always be kept at the top. After the filter it is recommended to place "Convert line breaks into HTML" and "Limit allowed HTML tags and correct faulty HTML" filters. The tags that should be allowed for proper working of the markdown filter are the following: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <h1 id> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id> <p> <br> <pre> <hr> <img src alt data-entity-type data-entity-uuid>. When using this filter with the CKEditor you need to press [Source] button on the editor while editing the markdown text. This is because markdown symbols are actually the source code similar to HTML tags. It is recommended to use this filter without any Rich Text Editor enabled on a text format.', [
':readmehelp' => Url::fromRoute('help.page', [
'name' => $this->provider,
])
->toString(),
':github' => 'https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet',
':name' => 'readmehelp-filter',
]),
];
return $form;
}