- ret.bullet.text = ustrdup(L"-");
-
- for (; source; source = source->next) {
- if (source->type == para_Config) {
- if (!ustricmp(source->keyword, L"text-indent")) {
- ret.indent = utoi(uadv(source->keyword));
- } else if (!ustricmp(source->keyword, L"text-indent-code")) {
- ret.indent_code = utoi(uadv(source->keyword));
- } else if (!ustricmp(source->keyword, L"text-width")) {
- ret.width = utoi(uadv(source->keyword));
- } else if (!ustricmp(source->keyword, L"text-list-indent")) {
- ret.listindentbefore = utoi(uadv(source->keyword));
- } else if (!ustricmp(source->keyword, L"text-listitem-indent")) {
- ret.listindentafter = utoi(uadv(source->keyword));
- } else if (!ustricmp(source->keyword, L"text-chapter-align")) {
- ret.achapter.align = utoalign(uadv(source->keyword));
- } else if (!ustricmp(source->keyword, L"text-chapter-underline")) {
- ret.achapter.underline = *uadv(source->keyword);
- } else if (!ustricmp(source->keyword, L"text-chapter-numeric")) {
- ret.achapter.underline = utob(uadv(source->keyword));
- } else if (!ustricmp(source->keyword, L"text-section-align")) {
- wchar_t *p = uadv(source->keyword);
+ ret.bullet.text = L"\x2022\0-\0\0";
+ ret.rule = L"\x2500\0-\0\0";
+ ret.filename = dupstr("output.txt");
+ ret.startemph = L"_\0_\0\0";
+ ret.endemph = uadv(ret.startemph);
+ ret.listsuffix = L".";
+ ret.charset = CS_ASCII;
+ /*
+ * Default quote characters are Unicode matched single quotes,
+ * falling back to the TeXlike `'.
+ */
+ ret.lquote = L"\x2018\0\x2019\0`\0'\0\0";
+ ret.rquote = uadv(ret.lquote);
+
+ /*
+ * Two-pass configuration so that we can pick up global config
+ * (e.g. `quotes') before having it overridden by specific
+ * config (`text-quotes'), irrespective of the order in which
+ * they occur.
+ */
+ for (p = source; p; p = p->next) {
+ if (p->type == para_Config) {
+ if (!ustricmp(p->keyword, L"quotes")) {
+ if (*uadv(p->keyword) && *uadv(uadv(p->keyword))) {
+ ret.lquote = uadv(p->keyword);
+ ret.rquote = uadv(ret.lquote);
+ }
+ }
+ }
+ }
+
+ for (p = source; p; p = p->next) {
+ if (p->type == para_Config) {
+ if (!ustricmp(p->keyword, L"text-indent")) {
+ ret.indent = utoi(uadv(p->keyword));
+ } else if (!ustricmp(p->keyword, L"text-charset")) {
+ ret.charset = charset_from_ustr(&p->fpos, uadv(p->keyword));
+ } else if (!ustricmp(p->keyword, L"text-filename")) {
+ sfree(ret.filename);
+ ret.filename = dupstr(adv(p->origkeyword));
+ } else if (!ustricmp(p->keyword, L"text-indent-code")) {
+ ret.indent_code = utoi(uadv(p->keyword));
+ } else if (!ustricmp(p->keyword, L"text-width")) {
+ ret.width = utoi(uadv(p->keyword));
+ } else if (!ustricmp(p->keyword, L"text-list-indent")) {
+ ret.listindentbefore = utoi(uadv(p->keyword));
+ } else if (!ustricmp(p->keyword, L"text-listitem-indent")) {
+ ret.listindentafter = utoi(uadv(p->keyword));
+ } else if (!ustricmp(p->keyword, L"text-chapter-align")) {
+ ret.achapter.align = utoalign(uadv(p->keyword));
+ } else if (!ustricmp(p->keyword, L"text-chapter-underline")) {
+ ret.achapter.underline = uadv(p->keyword);
+ } else if (!ustricmp(p->keyword, L"text-chapter-numeric")) {
+ ret.achapter.just_numbers = utob(uadv(p->keyword));
+ } else if (!ustricmp(p->keyword, L"text-chapter-shownumber")) {
+ ret.achapter.number_at_all = utob(uadv(p->keyword));
+ } else if (!ustricmp(p->keyword, L"text-chapter-suffix")) {
+ ret.achapter.number_suffix = uadv(p->keyword);
+ } else if (!ustricmp(p->keyword, L"text-section-align")) {
+ wchar_t *q = uadv(p->keyword);