31 "<hr><table border=0>"
37 " <td><b>" +
_(
"Keywords" ) +
"</b></td>"
38 " <td>__KEYWORDS__</td>"
43 " <td><b>" +
_(
"Documentation" ) +
"</b></td>"
44 " <td><a href=\"__HREF__\">__TEXT__</a></td>"
54 wxString url = data_field->
GetText();
62 size_t idx = desc.find( wxT(
"http:" ) );
64 if( idx == wxString::npos )
65 idx = desc.find( wxT(
"https:" ) );
67 if( idx == wxString::npos )
72 for(
auto chit = desc.begin() + idx; chit != desc.end(); ++chit )
77 if( ch <= 0x20 || ch >= 0x7F || ch ==
'"' )
83 else if( ch ==
')' && --nesting < 0 )
90 static wxString punct = wxS(
".,:;" );
92 if( punct.find( url.Last() ) != wxString::npos )
93 url = url.Left( url.Length() - 1 );
117 wxCHECK_RET(
m_fp_lib_table, wxT(
"Footprint library table pointer is not valid" ) );
129 wxLogError(
_(
"Error loading footprint %s from library '%s'." ) + wxS(
"\n%s" ),
149 esc_desc.Replace( wxS(
"\n" ), wxS(
"<br>" ) );
154 m_html.Replace(
"__DESC__", esc_desc );
158 keywordsHtml.Replace(
"__KEYWORDS__",
EscapeHTML( keywords ) );
161 docHtml.Replace(
"__HREF__",
EscapeHTML( doc ) );
163 if( doc.Length() > 75 )
164 doc = doc.Left( 72 ) + wxT(
"..." );
166 docHtml.Replace(
"__TEXT__",
EscapeHTML( doc ) );
168 m_html.Replace(
"__FIELDS__", keywordsHtml + docHtml );
virtual const wxString & GetText() const
Return the string associated with the text object.
const FOOTPRINT * GetEnumeratedFootprint(const wxString &aNickname, const wxString &aFootprintName)
A version of FootprintLoad() for use after FootprintEnumerate() for more efficient cache management.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
A logical library item identifier and consists of various portions much like a URI.
bool IsValid() const
Check if this LID_ID is valid.
const UTF8 & GetLibItemName() const
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
wxString EscapeHTML(const wxString &aString)
Return a new wxString escaped for embedding in HTML.
wxString UnescapeString(const wxString &aSource)
wxString LinkifyHTML(wxString aStr)
Wraps links in HTML tags.
@ DATASHEET
name of datasheet