Skip to content

Add default_processors configuration option for markdownify#166

Open
eelcoj wants to merge 1 commit intomainfrom
default-processors
Open

Add default_processors configuration option for markdownify#166
eelcoj wants to merge 1 commit intomainfrom
default-processors

Conversation

@eelcoj
Copy link
Contributor

@eelcoj eelcoj commented Mar 17, 2026

Allows configuring processors to run on every markdownify call via:

Perron.configure do |config|
  config.default_processors = [MyProcessor, "target_blank"]
end

Passing an explicit process: argument to markdownify overrides the defaults. Use Perron.configuration.default_processors + [additional] in your views if you need to combine defaults with additional per-call processors.

This seems the most flexible solution without being annoying to overide (eg like Rails default_scope).

Closes #123 /cc @ianyamey

Allows configuring processors to run on every markdownify call via:

```ruby
Perron.configure do |config|
  config.default_processors = [MyProcessor, "target_blank"]
end
```

Passing an explicit `process:` argument to markdownify overrides the defaults.
Use `Perron.configuration.default_processors + [additional]` in your views if you
need to combine defaults with additional per-call processors.

This seems the most flexible solution without being annoying to overide
(eg like Rails `default_scope`).
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.

Feature request: support default processors in configuration

1 participant