- docstring const & format = ctr.prettyFormat();
- // FIXME We need to "flatten" the format to get proper output,
- // but doing so will take a bit of work.
- if (true || format.empty()) {
- docstring cntrname = translateIfPossible(counter, lang);
- return cntrname + " " + theCounter(counter, lang);
- }
- return counterLabel(format, lang);
+
+ docstring const value = theCounter(name, lang);
+ docstring const & format =
+ translateIfPossible(ctr.prettyFormat(), lang);
+ if (format.empty())
+ return value;
+ return subst(format, from_ascii("##"), value);