ops_separate_line = ["<ol>", "</ol>", "<ul>", "</ul>", "@{", "@}", "<br>"]
+ # separate and do not break:
+ ops_title_line = ["@page", "@name"]
#todo:
# @arg @c @cond @em @endcond @f{ @internal @name @post @pre @sa
thisline = lines[idx].strip()[2:]
out.append(start + thisline)
- elif "@page" in lines[idx]:
- # do not break @page
+ elif one_in(ops_title_line, lines[idx]):
+ # do not break @page, etc.
if curlines!=[]:
out.extend(wrap_block(remove_junk(curlines), start))
curlines=[]
thisline = remove_junk([lines[idx]])[0]
- if not thisline.startswith("@page") and not thisline.startswith("(@page"):
- print ("%s warning %s not at start of line"%(infostr, "@page"), file=sys.stderr)
+
+ if not thisline.split(" ")[0] in ops_title_line:
+ print ("%s warning title not at start of line"%(infostr), file=sys.stderr)
out.append(start + thisline.strip())
elif "@ref" in lines[idx]:
lineO = lineI
assert(format_block(lineI)==lineO)
+# do not break @name:
+longtext = "bla bla"*20
+lineI = [" /**", \
+ " * @name " + longtext, \
+ " * hello", \
+ " */"]
+assert(format_block(lineI)==lineI)
#print (lineI)