* Appends strings as each rule requires and trims the output * @private * @param {String} output The conversion output * @returns A trimmed version of the ouput * @type String
(output)
| 827 | */ |
| 828 | |
| 829 | function postProcess (output) { |
| 830 | var self = this; |
| 831 | this.rules.forEach(function (rule) { |
| 832 | if (typeof rule.append === 'function') { |
| 833 | output = join(output, rule.append(self.options)); |
| 834 | } |
| 835 | }); |
| 836 | |
| 837 | return output.replace(/^[\t\r\n]+/, '').replace(/[\t\r\n\s]+$/, '') |
| 838 | } |
| 839 | |
| 840 | /** |
| 841 | * Converts an element node to its Markdown equivalent |