Skip to content

Incorrect XML magic identification when <title tag present #110

@IBazylchuk

Description

@IBazylchuk

If the XML has a <title tag, it is incorrectly identified as XML.

This behavior has been changed in this pull request https://github.com/rails/marcel/pull/74/files#diff-1fc2f7a3e2d7dad99c84d6f99f9eb59b810e6fde227789b70fa450163c39ee52R2402

Steps to reproduce

xml = %{<?xml version="1.0" encoding="UTF-8"?><source><jobs><job><title><![CDATA[Test tiltle]]></title><city><![CDATA[Boston]]></city><state><![CDATA[MA]]></state><zip/><country><![CDATA[USA]]></country></job></jobs></source>}

Marcel::Magic.by_magic(xml).type

# => "text/html"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions