| 2 | 2 | package com.keenwrite.processors.text; |
| 3 | 3 | |
| 4 | import com.keenwrite.util.Strings; |
| 5 | |
| 4 | 6 | import java.util.Map; |
| 5 | 7 | |
| ... |
| 31 | 33 | * recursively defined values must have been interpolated previously. |
| 32 | 34 | * |
| 33 | | * @param haystack The text containing zero or more variables to replace. |
| 34 | | * @param needles The map of variables to their dereferenced values. |
| 35 | * @param text The text containing zero or more variables to replace. |
| 36 | * @param needles The map of variables to their dereferenced values. |
| 35 | 37 | * @return The text with all variables replaced. |
| 36 | 38 | */ |
| 37 | 39 | public static String replace( |
| 38 | | final String haystack, final Map<String, String> needles ) { |
| 39 | | assert haystack != null; |
| 40 | final String text, final Map<String, String> needles ) { |
| 41 | final String haystack = Strings.sanitize( text ); |
| 40 | 42 | assert needles != null; |
| 41 | 43 | |