Mercurial > piecrust2
comparison piecrust/rendering.py @ 457:7d868afc6791
rendering: Truly skip formatters that are not enabled.
This make `smartypants` work as expected.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 09 Jul 2015 21:23:01 -0700 |
parents | 96d363e2da4b |
children | 16e705c58cae |
comparison
equal
deleted
inserted
replaced
456:5e902e228053 | 457:7d868afc6791 |
---|---|
380 raise Exception("You need to specify a format name.") | 380 raise Exception("You need to specify a format name.") |
381 | 381 |
382 format_count = 0 | 382 format_count = 0 |
383 format_name = format_name or app.config.get('site/default_format') | 383 format_name = format_name or app.config.get('site/default_format') |
384 for fmt in app.plugin_loader.getFormatters(): | 384 for fmt in app.plugin_loader.getFormatters(): |
385 if not fmt.enabled: | |
386 continue | |
385 if fmt.FORMAT_NAMES is None or format_name in fmt.FORMAT_NAMES: | 387 if fmt.FORMAT_NAMES is None or format_name in fmt.FORMAT_NAMES: |
386 with app.env.timerScope(fmt.__class__.__name__): | 388 with app.env.timerScope(fmt.__class__.__name__): |
387 txt = fmt.render(format_name, txt) | 389 txt = fmt.render(format_name, txt) |
388 format_count += 1 | 390 format_count += 1 |
389 if fmt.OUTPUT_FORMAT is not None: | 391 if fmt.OUTPUT_FORMAT is not None: |