Missing TidyNodeMBS.NodeIsStyle

After updating to MBS 24.4 TidyNodeMBS.NodeIsStyle is missing:

According to the docs this should be available(Monkeybread Xojo plugin - TidyNodeMBS properties). Bug?

No, in a newer tidy version, these Node Is functions got removed.
You may now need to check yourself whether Type property in TidyNodeMBS class is TidyTagIdMBS.TidyTagSTYLE.

I can’t get this to work. There is a break in the below code if the childnode has style information. But childNode.Type = TidyTagIdMBS.TidyTagSTYLE is no true.

dim theTidy as new TidyDocumentMBS
theTidy.OptionOutputXhtml = true
theTidy.OptionForceOutput = true
theTidy.OptionShowWarnings = False
theTidy.OptionShowErrors = 0

call theTidy.ParseString(html)
call theTidy.SetOutputCharacterEncoding("utf8")

dim gotStyle as Boolean

' Check if there is a style node in the head
dim headerNode as TidyNodeMBS = theTidy.Head

dim childNode as TidyNodeMBS = headerNode.Child
while childNode <> nil
  if childNode.Text.IndexOf("style") > -1 then Break
  if childNode.Type = TidyTagIdMBS.TidyTagSTYLE then
    gotStyle = True
    Exit
  end if
  childNode = childNode.NextNode
wend

Example:
tidy.xojo_xml_project.zip (14.3 KB)

if childNode.ID = TidyTagIdMBS.TidyTagSTYLE then

Check ID, not Type, please.

1 Like