richlowe/illumos-fmaweb-wip — comment on commit 151e720bd752d56ac8827274be7038dd8a825ea1
File:  line 0
By jclulow:

So, I tested this a little and expandMacros() doesn't work on the included HTML output for two reasons:

* readFileSync returns a Buffer if you don't specify an encoding, but to use replace() we need a String
* we're not passing it any macros (which is why it isn't throwing a 'has no method' exception)

Probably want something like this, I guess:

```diff
@@ -99,7 +99,8 @@ module.exports.getMessage = function getMessage(msgid, macros, cb) {
} else if (tag === "use") {
var file = path.join(HTMLPATH, current_text);
try {
- output[current_name] = expandMacros(fs.readFileSync(file));
+ output[current_name] = expandMacros(fs.readFileSync(file, 'utf8'),
+ macros);
} catch (e) {
fail("could not include file: " + e);
}
```

or I can merge and fix it afterwards.