Lift and wrapIn


#1

Recently i’m working on implement alignment.

I give three nodeTypes, align_left, align_center and align_right.

I use wrap to achieve alignment, and lift to remove alignment.

But when I want to change alignment such as from right to center, I need to first lift it then wrap it.

I get errors when tr.lift().wrap().

How can I achieve this?

Thanks!


#2

Both those methods take arguments, so that might be the problem.


#4

@marijn

I am sorry to let you misunderstand.

tr.lift().wrap() is shorthand, I added parameters when I called, but I still get an error.

I just want you to know my way to achieve lift and then wrap , it’s the right way?

I actually want to ask how to achieve lift and wrap .

I’m so sorry about that.

thx again!


#5

Since you didn’t really show what you did, it’s hard for me to figure out what went wrong. You probably won’t be able to chain them like that, even with parameters, since wrap will need a block range pointing into the new document, after lift.