Skip to content

Commit

Permalink
fix: switch from broken simplifyPath to functioning thoughtToPath wit…
Browse files Browse the repository at this point in the history
…hin the formatWithTag action
  • Loading branch information
trevinhofmann committed Nov 30, 2024
1 parent 333617a commit 092549b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/actions/formatWithTag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import FormattingCommand from '../@types/FormattingCommand'
import Thunk from '../@types/Thunk'
import * as selection from '../device/selection'
import pathToThought from '../selectors/pathToThought'
import simplifyPath from '../selectors/simplifyPath'
import thoughtToPath from '../selectors/thoughtToPath'
import suppressFocusStore from '../stores/suppressFocus'
import getCommandState from '../util/getCommandState'
import strip from '../util/strip'
Expand All @@ -16,7 +16,7 @@ export const formatWithTagActionCreator =
const state = getState()
if (!state.cursor) return
const thought = pathToThought(state, state.cursor)
const simplePath = simplifyPath(state, state.cursor)
const simplePath = thoughtToPath(state, thought.id)
suppressFocusStore.update(true)

const tagRegExp = new RegExp(`<${tag}[^>]*>|<\/${tag}>`, 'g')
Expand Down

0 comments on commit 092549b

Please sign in to comment.