Skip to content

Commit 81ea1bb

Browse files
committed
Return the full node path
1 parent a639ad6 commit 81ea1bb

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

figma-html/src/lib.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,11 @@ pub fn file_collect_css_variables(file: &figma_schema::File) -> CSSVariablesMap
3737
pub fn find_figma_node_by_id<'a>(
3838
file: &'a figma_schema::File,
3939
node_id: &str,
40-
) -> Option<&'a figma_schema::Node> {
41-
let (node, _) = file
40+
) -> Option<(&'a figma_schema::Node, Vec<&'a Node>)> {
41+
file
4242
.document
4343
.depth_first_stack_iter()
44-
.find(|(n, _)| n.id == node_id)?;
45-
Some(node)
44+
.find(|(n, _)| n.id == node_id)
4645
}
4746

4847
pub fn figma_node_to_intermediate_node<'a>(

src/to_html/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub fn main(
1212
_stderr: &mut impl Write,
1313
node_id: &str,
1414
) -> Result<()> {
15-
let body = find_figma_node_by_id(file, node_id)
15+
let (body, _) = find_figma_node_by_id(file, node_id)
1616
.with_context(|| format!("Failed to find node with id {}", node_id))?;
1717

1818
let mut css_variables = file_collect_css_variables(file);

0 commit comments

Comments
 (0)