Permalink
Browse files

Add get id attributes method

  • Loading branch information...
nvh committed Jan 26, 2018
1 parent 8744c3e commit 8bb17ec3a40a6b47ab9c8e59b8e4b5b36ff03393
Showing with 10 additions and 0 deletions.
  1. +10 −0 framer/Utils.coffee
@@ -1422,4 +1422,14 @@ Utils.throwInStudioOrWarnInProduction = (message) ->
console.warn(message)
return null

Utils.getIdAttributesFromString = (string) ->
regex = /id=['"]([^'"]+)["']/g
matches = []
while (m = regex.exec(string))
id = m[1]
if id?
matches.push(id)
matches


_.extend exports, Utils

0 comments on commit 8bb17ec

Please sign in to comment.