delphidabbler/codesnip

Snippets editor sometimes strips `<p>` REML tags

delphidabbler opened this issue · 2 comments

When editing a snippet that has a description or extra information that contains a single paragraph embedded in <p>..</p> REML tags, the tags are getting stripped and the paragraph is treated as plain text.

That was OK before issues #81 and #82 got fixed, but now it's causing active text that should be treated as a paragraph to be treated as an un-formatted block.

Problem could be here:

function TActiveText.IsPlainText: Boolean;
var
  Elem: IActiveTextElem;
  ActionElem: IActiveTextActionElem;
begin
  for Elem in fElems do
  begin
    if Supports(Elem, IActiveTextActionElem, ActionElem)
      and not (ActionElem.Kind in [ekPara, ekDocument]) then
      Exit(False);
  end;
  Result := True;
end;

Need to change test

    if Supports(Elem, IActiveTextActionElem, ActionElem)
      and not (ActionElem.Kind in [ekPara, ekDocument]) then

to

    if Supports(Elem, IActiveTextActionElem, ActionElem)
      and not (ActionElem.Kind in [ekBlock, ekDocument]) then

Fixed by merge commit 483496a