@player-ui/markdown-plugin 0.14.1 → 0.14.2--canary.752.28969

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5803,32 +5803,45 @@ var MarkdownPlugin = function() {
5803
5803
  var parseAssetMarkdownContent = // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/markdown/core/src/utils/markdownParser.ts
5804
5804
  function parseAssetMarkdownContent(param) {
5805
5805
  var asset = param.asset, mappers = param.mappers, parser = param.parser;
5806
- var children = fromMarkdown(asset.value).children;
5807
- var isMultiParagraph = children.length > 1;
5808
- if (isMultiParagraph) {
5809
- var value = children.map(function(node2) {
5810
- var transformer2 = transformers[node2.type];
5811
- return transformer2({
5812
- astNode: node2,
5813
- asset: asset,
5814
- mappers: mappers,
5815
- transformers: transformers
5816
- });
5817
- });
5818
- var collection = mappers.collection({
5806
+ var _asset_value;
5807
+ var input = (_asset_value = asset.value) !== null && _asset_value !== void 0 ? _asset_value : "";
5808
+ var children = fromMarkdown(input).children;
5809
+ if (children.length === 0) {
5810
+ var empty = mappers.text({
5819
5811
  originalAsset: asset,
5820
- value: value
5812
+ value: ""
5813
+ });
5814
+ return (parser === null || parser === void 0 ? void 0 : parser(empty, NodeType.Asset)) || null;
5815
+ }
5816
+ var value = children.map(function(node2) {
5817
+ var transformer = transformers[node2.type];
5818
+ if (!transformer) {
5819
+ return mappers.text({
5820
+ originalAsset: asset,
5821
+ value: ""
5822
+ });
5823
+ }
5824
+ return transformer({
5825
+ astNode: node2,
5826
+ asset: asset,
5827
+ mappers: mappers,
5828
+ transformers: transformers
5821
5829
  });
5822
- return (parser === null || parser === void 0 ? void 0 : parser(collection, NodeType.Asset)) || null;
5823
- }
5824
- var transformer = transformers[children[0].type];
5825
- var content3 = transformer({
5826
- astNode: children[0],
5827
- asset: asset,
5828
- mappers: mappers,
5829
- transformers: transformers
5830
5830
  });
5831
- return (parser === null || parser === void 0 ? void 0 : parser(content3, NodeType.Asset)) || null;
5831
+ if (value.length === 1) {
5832
+ var _value = _sliced_to_array(value, 1), first = _value[0];
5833
+ return (parser === null || parser === void 0 ? void 0 : parser(first, NodeType.Asset)) || null;
5834
+ }
5835
+ var collection = mappers.collection({
5836
+ originalAsset: asset,
5837
+ value: value
5838
+ });
5839
+ return (parser === null || parser === void 0 ? void 0 : parser(collection, NodeType.Asset)) || null;
5840
+ };
5841
+ var isMarkdownAssetNode = // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/markdown/core/src/index.ts
5842
+ function isMarkdownAssetNode(node2) {
5843
+ if (node2.type !== NodeType.Asset) return false;
5844
+ return node2.value.type === "markdown";
5832
5845
  };
5833
5846
  var __create = Object.create;
5834
5847
  var __defProp = Object.defineProperty;
@@ -15072,7 +15085,6 @@ var MarkdownPlugin = function() {
15072
15085
  heading: headingTransformer,
15073
15086
  inlineCode: inlineCodeTransformer
15074
15087
  };
15075
- // ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/markdown/core/src/index.ts
15076
15088
  var MarkdownPlugin = /*#__PURE__*/ function() {
15077
15089
  function MarkdownPlugin(mappers) {
15078
15090
  _class_call_check(this, MarkdownPlugin);
@@ -15087,8 +15099,10 @@ var MarkdownPlugin = function() {
15087
15099
  player.hooks.view.tap(this.name, function(view) {
15088
15100
  view.hooks.resolver.tap(_this.name, function(resolver2) {
15089
15101
  resolver2.hooks.beforeResolve.tap(_this.name, function(node2, options) {
15090
- if ((node2 === null || node2 === void 0 ? void 0 : node2.type) === NodeType.Asset && node2.value.type === "markdown") {
15091
- var resolvedContent = resolveDataRefsInString(node2.value.value, {
15102
+ if (node2 && isMarkdownAssetNode(node2)) {
15103
+ var _node2_value_value;
15104
+ var rawValue = (_node2_value_value = node2.value.value) !== null && _node2_value_value !== void 0 ? _node2_value_value : "";
15105
+ var resolvedContent = resolveDataRefsInString(rawValue, {
15092
15106
  evaluate: options.evaluate,
15093
15107
  model: options.data.model
15094
15108
  });