deprecated-packages/mdxc/src/jsx_inline.js
function parseJSXContent(state, start, type) {
  var text,
      result,
      max = state.posMax,
      prevPos,
      oldPos = state.pos;

  state.pos = start;

  while (state.pos < max) {
    text = state.src.slice(state.pos)
    result = JSX_INLINE_CLOSE_TAG_PARSER.parse(text)

    prevPos = state.pos;
    state.md.inline.skipToken(state);

    if (result.status && result.value.value === type && prevPos === state.pos - 1) {
      // restore old state
      state.pos = oldPos;
      return { contentEnd: prevPos, closeEnd: prevPos + result.value.end.offset }
    }
  }

  // restore old state
  state.pos = oldPos;
}
function parseJSXContent(state, start, type) {
  var text,
      result,
      max = state.posMax,
      prevPos,
      oldPos = state.pos;

  state.pos = start;

  while (state.pos < max) {
    text = state.src.slice(state.pos)
    result = JSX_INLINE_CLOSE_TAG_PARSER.parse(text)

    prevPos = state.pos;
    state.md.inline.skipToken(state);

    if (result.status && result.value.value === type && prevPos === state.pos - 1) {
      // restore old state
      state.pos = oldPos;
      return { contentEnd: prevPos, closeEnd: prevPos + result.value.end.offset }
    }
  }

  // restore old state
  state.pos = oldPos;
}
function parseJSXContent ( state , start , type ) { var text , result , max = state . posMax , prevPos , oldPos = state . pos ; state . pos = start ; while ( state . pos < max ) { text = state . src . slice ( state . pos ) result = JSX_INLINE_CLOSE_TAG_PARSER . parse ( text ) prevPos = state . pos ; state . md . inline . skipToken ( state ) ; if ( result . status && result . value . value === type && prevPos === state . pos - 1 ) { // restore old state state . pos = oldPos ; return { contentEnd : prevPos , closeEnd : prevPos + result . value . end . offset } } } // restore old state state . pos = oldPos ; }
Iterate through a JSX tag's content until the closing tag is found, making sure to skip nested JSX and to not match closing tags in code blocks.
Iterate through a JSX tag s content until the closing tag is found making sure to skip nested JSX and to not match closing tags in code blocks .