我刚刚追踪到某人项目中崩溃的原因,是一行代码。不幸的是,有人在编写 FRT 书籍模板时犯了一个错误,导致这行代码被包含在内:
\rem sorta will sort by \toc1, sortb by \toc2, sortc by \toc3
这几乎肯定会导致崩溃或未定义行为。
如果您的前言(Front matter)中包含该行,请将其修改为:
\rem sorta will sort by toc1, sortb by toc2 , sortc by toc3
即去掉斜杠。否则您将会遇到崩溃问题。
早期版本的 USFM 标准有些模糊,但 Paratext 和 USFM-3 标准并未将 \rem 描述为“忽略本行剩余部分”,而是将其描述为一种不产生输出的段落样式。
这意味着:
-
\rem 一直持续到下一个段落标记
-
\rem 仍然必须处理其中包含的任何标记。(否则它如何发现下一个段落标记?)
- 由于
\toc1 等也被描述为段落标记(尽管未作为此类使用),它们应该会取消 \rem
I’ve just tracked down the cause of a crash on someone’s project to a line Unfortunately there was a think-o when someone was writing the template for FRT books, and this line was included:
\rem sorta will sort by \toc1, sortb by \toc2, sortc by \toc3
This is pretty much guaranteed to cause a crash / undefined behaviour.
If you have a Front matter that includes that line, change it so that it reads:
\rem sorta will sort by toc1, sortb by toc2 , sortc by toc3
I.e. remove the slashes. Otherwise you will experience crashes.
Earlier versions of the USFM standard were a bit vague, but Paratext and the USFM-3 standard do NOT describe \rem as ‘ignore the rest of this line’, but as a paragraph style that produces no output.
This means:
-
\rem continues until the next paragraph marker
-
\rem still has to process any markers it contains. (how else will it spot the next paragraph-marker?).
- Since
\toc1 and friends are also described as paragraph markers (although not used as such) they should cancel \rem
机器翻译自 English