Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement substitute method on TextRun class #75

Merged
merged 1 commit into from
Dec 31, 2019

Conversation

misdoro
Copy link
Contributor

@misdoro misdoro commented Dec 9, 2019

Enables substituting text in multi-line paragraphs, preserving formatting and text styles.

Example usage:

doc.paragraphs.each do |p|
  p.each_text_run do |tr|
    tr.substitute('_placeholder_', 'replacement value')
  end
end

Solves #56

lib/docx/containers/text_run.rb Outdated Show resolved Hide resolved
Enables substituting text in multi-line paragraphs, preserving formatting and text styles.

Example usage:
```
doc.paragraphs.each do |p|
  p.each_text_run do |tr|
    tr.substitute('_placeholder_', 'replacement value')
  end
end
```
@misdoro misdoro changed the title Implement gsub! method on TextRun class Implement substitute method on TextRun class Dec 30, 2019
@misdoro misdoro requested a review from satoryu December 30, 2019 23:58
@satoryu satoryu merged commit bb823da into ruby-docx:master Dec 31, 2019
@satoryu
Copy link
Member

satoryu commented Dec 31, 2019

@misdoro
Thanks!
Have a nice year!

@misdoro misdoro deleted the text_run_gsub! branch December 31, 2019 10:04
@misdoro misdoro mentioned this pull request Jan 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants