- string tcmdname, toptions, tcontents;
-
- if (cmd.empty()) return;
-
- enum { WS, CMDNAME, OPTION, CONTENT } state = WS;
-
- // Used to handle things like \command[foo[bar]]{foo{bar}}
- int nestdepth = 0;
-
- for (string::size_type i = 0; i < cmd.length(); ++i) {
- char c = cmd[i];
- if ((state == CMDNAME && c == ' ') ||
- (state == CMDNAME && c == '[') ||
- (state == CMDNAME && c == '{')) {
- state = WS;
- }
- if ((state == OPTION && c == ']') ||
- (state == CONTENT && c == '}')) {
- if (nestdepth == 0) {
- state = WS;
- } else {
- --nestdepth;
- }
- }
- if ((state == OPTION && c == '[') ||
- (state == CONTENT && c == '{')) {
- ++nestdepth;
- }
- switch (state) {
- case CMDNAME: tcmdname += c; break;
- case OPTION: toptions += c; break;
- case CONTENT: tcontents += c; break;
- case WS:
- if (c == '\\') {
- state = CMDNAME;
- } else if (c == '[') {
- state = OPTION;
- nestdepth = 0; // Just to be sure
- } else if (c == '{') {
- state = CONTENT;
- nestdepth = 0; // Just to be sure
- }
- break;
- }
- }
+ os << getCommand();
+ return 0;
+}
+
+
+int InsetCommand::plaintext(Buffer const &, odocstream &,
+ OutputParams const &) const
+{
+ return 0;
+}
+