- Dropped IE 11 support. Modern browsers now required.
Interweave
is no longer a default export, and is now a named export.
- Added
rel
attribute to the allow list. - Added support for React 18.
- Updated to latest
packemon
.
- Migrated to Beemo for build and developer tooling.
- Added a
transformOnlyAllowList
to filter out unknown elements when transforming.
- Added a
className
prop, which is passed to the wrapping element.
- Updated
Markup
to render aspan
by default (instead ofdiv
). This functionality now matchesInterweave
and the docs.
- Add an undefined check for
global
.
- Updated all dependencies.
- Include source folder for source maps work correctly.
- Switched to Packemon for package building.
- Updated test data and fixtures.
- Added support for React 17.
- Add support for an improved form of SSR.
- Enable the
loading
attribute.
- Added an
attributes
prop toInterweave
andMarkup
in which custom HTML attributes can be passed.
- Parser will now no-op during SSR if there is no document and
interweave-ssr
has not be setup.
- Added a
match
function for handling pre-defined matcher logic. - Added a
noWrap
prop that doesn't wrap content with an element (uses React fragments). - Added a
containerTagName
prop which allows content to be contextual parsed based on a specific parent tag name (like parsingli
within aul
).
- Updated all dependencies.
- Fixed an issue with testing utils where duplicate Interweave instances were being used.
- Renamed
testUtils
totesting
.
- Migrated build to Rollup for a smaller filesize.
- Add
tel:
to the list of safe protocols.
- Added a
greedy
option to matchers. - Added support for
void
elements (self closing).
- Updated
react
requirement to v16.8. - Updated
Matcher#createElement
andMatcher#replaceWith
to receive any React node, not just the matched string. - Updated
Matcher#match
response structure. Must returnindex
,length
, andvalid
properties.
- Added interleaving supports to matchers, which allows for nested elements to be possible. Required a heavy rewrite of the parsing and matching layer, so may incur performance regressions.
- Rewrote all components to use function components. Reduced file sizes by 35%.
- Updated all dependencies.
- Added
start
to the attribute allow list.
- Updated all dependencies.
- [TS] Updated
Filter#attribute
types to extend fromReact.AllHTMLAttributes
. - [TS] Refined some internal types to not use
any
.
- Migrated from
enzyme
torut
for React testing.
- Added new attributes to allow list:
media
,scope
,srclang
,style
.- Style properties that contain
image()
,image-set()
, orurl()
are removed.
- Style properties that contain
- Namespace and data attributes are also now rendered.
- Fixed many parent <-> child relationships as part of the new rendering hierarchy.
figure
now supports all flow content.header
can now be rendered at the root.
- Filters are now applied after attributes have been type casted, instead of before.
- Removed
canvas
andiframe
from the default allow list (they should have been opt-in). - [TS] Fixed some default props issues.
- Updated all
@types
dependencies to use*
version.
The previous version of Interweave would attempt to render valid parent and child hierarchies based
on their inline
, block
, and inline-block
presentation. This worked for the majority, but broke
down hard in minority edge cases. This valid rendering hierarchy has been rewritten from the ground
up using
content categories.
Because of this, some old HTML may now be invalid, while some additional HTML tags are now
renderable.
- Updated IE requirement to v11.
- Renamed
TAGS_BLACKLIST
toBANNED_TAG_LIST
. - Removed
PARSER_ALLOW
,PARSER_DENY
,TYPE_INLINE
,TYPE_BLOCK
,TYPE_INLINE_BLOCK
,CONFIG_INLINE
, andCONFIG_BLOCK
constants. - Removed
disableWhitelist
prop. UseallowAttributes
orallowElements
instead. - Removed
iframe
andcanvas
tags from the banned list. They are not in the default allow list but can be enabled by the consumer.
Parser
andElement
are now exported from the index.- Added
TYPE_FLOW
,TYPE_SECTION
,TYPE_HEADING
,TYPE_PHRASING
,TYPE_EMBEDDED
,TYPE_INTERACTIVE
, andTYPE_PALPABLE
constants. - Added
allowAttributes
prop, which disables all non-banned HTML attribute filtering. - Added
allowElements
prop, which disables all non-banned HTML element filtering. - Added
allowList
prop, which only enables specific HTML elements. Defaults to theALLOWED_TAG_LIST
constant. - Added
blockList
prop, which disables specific HTML elements. - Added
escapeHtml
prop, which escapes all HTML before parsing. - Added support for HTML tags:
bdi
,bdo
,caption
,col
,colgroup
,rb
,rp
,rt
,rtc
,ruby
,small
.
- Removed
@babel/runtime
as it wasn't saving much space. - [TS] Switched to project references.
- [TS] Updated
NodeConfig
to match the new rendering strategy.
- More ESM improvements.
- Updated dependencies.
- Added missing
@babel/runtime
package.
- Fixed an issue with TS types being exported from the ESM index.
- Added ECMAScript module support via
esm/
built files. - Removed copyright docblocks from source files to reduce bundle size.
- Tested with React v16.8.
- HTML attributes in which their value is falsy will now be treated as enabled attributes, according the official HTML spec.
- Newlines will now be converted to
<br/>
tags whennoHtmlExceptMatchers
is passed. - PropType shapes have been removed.
- Enabled the
type
attribute for all HTML elements. - Updated
tagName
prop to support any JSX supported HTML tag.
- Fixed a bug in which content starting with BBCode (
[html]
) were not being parsed.
- Added
srcSet
to the React attribute to prop mapping.
- Added
srcset
andsizes
to the attribute whitelist. - Updated
transform
to support blacklisted tags as a means to intercept. This allows tags likeiframe
andcanvas
to be used when handled manually.
TypeScript
- Added a new
Node
type to resolve React node issues.- Only accepts
null
,string
, andReact.ReactElement
. - Replaced all
React.ReactNode[]
types withNode[]
.
- Only accepts
- Updated minimum
react
requirement to 16.3. - Updated
Interweave
to extendReact.PureComponent
. - Updated
Interweave
andMarkup
prop to defaulttagName
todiv
(fromspan
). - Removed
className
andcommonClass
props.- If you require custom class names, use a
Filter
and append to the node manually.
- If you require custom class names, use a
- Refactored
Matcher
factories to use a React component reference, instead of a factory function.
- Fixed issues when
null
was passed tocontent
.
- Converted from Flow to TypeScript.
- Moved documention to Gitbook.
- Added a
commonClass
prop to control the class name for all Interweave elements. - Added a
transform
prop to hook into the parsing process. - Updated
tagName
prop to accept "fragment", in which aReact.Fragment
will be rendered.
- Fixed a bug where passing a
null
content withonBeforeParse
would throw errors.
- Tested against React 16.1.
- Improved build process.
- Fixed dependencies.
- The API for filters have changed. Filters now support nodes as well as attributes.
- The
filter()
method has been removed. - A new
attribute(name, value)
method has been added (works like the previous implementation). - A new
node(tagName, node)
method has been added.
- The
- Updated
prop-types
to 15.6.
- Tested against React 16.
- Moved autolinking functionality to a new package, interweave-autolink.
- Moved emoji functionality to a new package, interweave-emoji.
- Updated
react
peer dependency requirement to 15.3. - Migrated
Markup
,Element
,Email
,Hashtag
,Link
, andUrl
components toReact.PureComponent
.
- Matchers can now be defined as objects instead of a class that extends
Matcher
. - Filters can now be defined as objects instead of a class that extends
Filter
. - Added
FilterShape
andMatcherShape
prop types.
- Split Interweave into a multi-package repository using Yarn workspaces and Lerna.
- Major refactor and cleanup on Flowtype usage.
- Major improvements to emoticon matching and parsing.
- Updated Flowtype definitions with more generics.
- Updated
emojibase
to 1.3.0. - Updated
emojibase-regex
to 1.0.4.
- Migrated from
emoji-database
toemojibase
, which is now a peer dependency. - Matcher files have been renamed and suffixed with
Matcher
. - Renamed all usage of
shortname
toshortcode
.
- Added support for React 16.
- Emoji data is now fetched from a CDN instead of being bundled locally.
- Added new
EmojiLoader
component to handle the loading of emoji data. - Added localized emoji data.
- Added new
- Emoticon support has been added. Convert emoticons to emoji!
- Updated
Emoji
component.- Added new
emoticon
prop. - Added
title
,aria-label
, anddata-emoticon
element attributes. - Renamed
shortname
prop toshortcode
. - Renamed
data-shortname
todata-shortcodes
.
- Added new
- Updated
EmojiMatcher
.- Added new
convertEmoticon
option. - Renamed
convertShortname
option toconvertShortcode
.
- Added new
- Fixed and updated Flowtype and React definitions.
- Updated
emoji-database
to 0.9. - Updated
enlargeThreshold
to ignore whitespace when counting. - Fixed a bug in which emoji counts below the
enlargeThreshold
were not being enlarged.
- Added a new
emojiLargeSize
prop, which can be used to customize the size of enlarged emoji.- Also passed as the 4th argument to the
emojiPath
function.
- Also passed as the 4th argument to the
- Added a new
enlargeThreshold
option toEmojiMatcher
, which determines the number of emojis to automatically enlarge, when emojis are the only content. - Updated
Matcher#onBeforeParse
andMatcher#onAfterParse
to receives the entire props object as the 2nd argument. - Wrapped thrown errors in
process.env.NODE_ENV !== 'production'
environment checks. - Improvements to Flow definitions.
- Added a new
noHtmlExceptMatchers
prop. - Fixed a bug in which matcher after callbacks were not triggering properly.
- Fixed prefixed TLDs not being matched correctly.
- Updated
emoji-database
to 0.8. - Fixed IE 10 compiled lib/ issues.
- Updated support for
react
15.6. - Updated
emoji-database
to 0.7. - Updated
UrlMatcher
to validate against a common whitelist of TLDs (no longer wildcard). - Added
customTLDs
andvalidateTLD
options toUrlMatcher
.
- Fixed an issue with the index import failing.
- Updated IE requirement to 11+.
- Updated to include src/ files in the published package.
- Updated Flow definitions.
- Moved Flow definition to root of project.
- Moved published files to a lib/ folder.
- Updated the
emojiPath
function to receiveenlargeEmoji
as the 2nd argument, andemojiSize
as the 3rd argument. - Updated EmojiOne CDN.
- Updated support for React 15.5 and the new
prop-types
package. - Updated emoji parsing and rendering to use emoji-database, which also supports EmojiOne 3.0, and the latest emoji unicode specification.
- Updated the
Emoji
component's renderedimg
element to use the emoji unicode character as thealt
attribute. - Updated the
Emoji
component'semojiPath
prop to accept a function, which is passed the emoji hexadecimal code (without ZWJ). - Updated the
Hashtag
component'shashtagUrl
prop to accept a function, which is passed the hashtag. - Updated all emoji hexadecimal codes to be uppercase.
- Renamed
Emoji
component propshortName
toshortname
. - Renamed
EmojiMatcher
optionconvertShortName
toconvertShortname
. - Removed the emoji dataset and regex generation from Interweave.
- Fixed a few issues with the flowtype definitions.
- Added an
emojiSize
prop to theEmoji
component, which will scale the size of the emoji using inline styles. - Updated the
Emoji
component to returnimg
instead ofspan
. - Removed the extension specific class name from the
Emoji
element.
- Fixed an issue with the published build.
- Added support for
/
and\
in URL query string parsing.
- Updated to no longer support parsing entire HTML documents.
- This includes content that starts with
<!DOCTYPE>
,<html>
,<head>
, and<body>
. - Will now throw an error if the content is invalid.
- This includes content that starts with
- Updated to treat all non-whitelist and non-blacklist tags as pass-through.
- Will now render children for tags that were not previously supported.
- Added a new
disableWhitelist
prop toInterweave
andMarkup
components, that disables the automatic HTML tag and attribute filtering. - Added
CONFIG_INLINE
andCONFIG_BLOCK
constants. - Removed the
PARSER_PASS_THROUGH
constant.
- Added
Parser#isSafe
to verify that a node is safe from injection attacks. - Fixed an issue with specific anchor link
javascript:
attacks being permitted.
- Fixed an issue with surrogate pair emojis rendering separately. For example, the MWGB family emoji should now render as a single emoji, instead of 4 individual.
- Improved the efficiency of the emoji regex pattern.
- Fixed an issue with the NPM package.
- Removed the concept of global configuration. Composition should be used instead.
- When an emoji is the only character parsed as the content, it will automatically be enlarged.
- Added a
preserveHash
prop to theHashtag
component to not strip the hash. - Added an
enlargeEmoji
prop to theEmoji
component that will append a large class name. - Added
onBeforeParse
andonAfterParse
callback methods to all matchers. - Updated the
Hashtag
component to strip the hash (#) when replacing{{hashtag}}
. - Updated the
Emoji
component to prefix the file extension class name withinterweave__emoji--
. - Removed
Interweave#addFilter
,addMatcher
,clearFilters
,clearMatchers
,getFilters
,getMatchers
, andconfigure
.
- Updated emoji to the latest EmojiOne dataset.
- Fixed an issue with the published build.
- Line breaks found in non-HTML strings will now be automatically converted to
<br/>
tags. - Added a
disableLineBreaks
prop toInterweave
andMarkup
, which will disable the automatic line break conversion. - Added an
interweave
class to all rendered HTML elements. - Added an
interweave--no-html
class whennoHtml
is enabled. - Updated the
content
prop to accept null or undefined values. Will default to an empty string. - Removed the
data-interweave
attribute from elements. - Removed the
className
prop fromInterweave
andMarkup
. - Fixed an issue where void elements (
br
,hr
, etc) would not render correctly.
- Fixed an issue in which empty parses would pass an empty child to
Element
, triggering a prop type failure.
- Initial release!