<commit_before>import { mergeData } from 'vue-functional-data-merge'
import pluckProps from '../../utils/pluck-props'
import { assign } from '../../utils/object'
import Link, { propsFactory as linkPropsFactory } from '../link/link'

export const props = assign(linkPropsFactory(), {
  text: {
    type: String,
    default: null
  },
  active: {
    type: Boolean,
    default: false
  },
  href: {
    type: String,
    default: '#'
  },
  ariaCurrent: {
    type: String,
    default: 'location'
  }
})

export default {
  functional: true,
  props,
  render (h, { props: suppliedProps, data, children }) {
    const tag = suppliedProps.active ? 'span' : Link

    let componentData = {
      props: pluckProps(props, suppliedProps),
      domProps: { innerHTML: suppliedProps.text }
    }

    if (suppliedProps.active) {
      componentData.attrs = { 'aria-current': suppliedProps.ariaCurrent }
    } else {
      componentData.attrs = { href: suppliedProps.href }
    }

    return h(tag, mergeData(data, componentData), children)
  }
}
<commit_msg>feat(breadcrumb-link): support children elements (#1832) (#1833)<commit_after>import { mergeData } from 'vue-functional-data-merge'
import pluckProps from '../../utils/pluck-props'
import { assign } from '../../utils/object'
import Link, { propsFactory as linkPropsFactory } from '../link/link'

export const props = assign(linkPropsFactory(), {
  text: {
    type: String,
    default: null
  },
  active: {
    type: Boolean,
    default: false
  },
  href: {
    type: String,
    default: '#'
  },
  ariaCurrent: {
    type: String,
    default: 'location'
  }
})

export default {
  functional: true,
  props,
  render (h, { props: suppliedProps, data, children }) {
    const tag = suppliedProps.active ? 'span' : Link

    let componentData = { props: pluckProps(props, suppliedProps) }
    if (suppliedProps.active) {
      componentData.attrs = { 'aria-current': suppliedProps.ariaCurrent }
    } else {
      componentData.attrs = { href: suppliedProps.href }
    }

    return h(tag, mergeData(data, componentData), children || suppliedProps.text)
  }
}

{'fraction_non_alphanumeric': 0.13827277017461068, 'fraction_numerical': 0.0037753657385559227, 'mean_word_length': 3.1005802707930368, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7477507', 'n_tokens_mistral': 661, 'n_tokens_neox': 650, 'n_words': 163}