mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 02:28:35 +00:00
tex2lyx: put adjacent comment lines in one ERT inset (#4797)
This commit is contained in:
parent
8b5bfa971b
commit
7868929aac
@ -2701,9 +2701,14 @@ void parse_comment(Parser & p, ostream & os, Token const & t, Context & context,
|
||||
bool skipNewlines = false)
|
||||
{
|
||||
LASSERT(t.cat() == catComment, return);
|
||||
if (!t.cs().empty()) {
|
||||
string comment = t.cs();
|
||||
// Join multiple consecutive comment lines into one ERT inset
|
||||
while (p.next_token().cat() == catComment)
|
||||
comment += "\n%" + p.get_token().cs();
|
||||
|
||||
if (!comment.empty()) {
|
||||
context.check_layout(os);
|
||||
output_comment(p, os, t.cs(), context);
|
||||
output_comment(p, os, comment, context);
|
||||
if (p.next_token().cat() == catNewline) {
|
||||
// A newline after a comment line starts a new
|
||||
// paragraph
|
||||
|
Loading…
Reference in New Issue
Block a user